X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=CAN-binder%2Flow-can-binding%2Fcan%2Fcan-bus-dev.hpp;h=38727e0308a29309ff5b7fc6ab53fa0cb7032865;hb=45dd042f924236be04d4e4292de111f80a004060;hp=3e6b2d1ca8e2b58b69a5bbad8029c901c9559236;hpb=f546e121079088920e2a3f64bc054afa05ff945f;p=apps%2Fagl-service-can-low-level.git diff --git a/CAN-binder/low-can-binding/can/can-bus-dev.hpp b/CAN-binder/low-can-binding/can/can-bus-dev.hpp index 3e6b2d1c..38727e03 100644 --- a/CAN-binder/low-can-binding/can/can-bus-dev.hpp +++ b/CAN-binder/low-can-binding/can/can-bus-dev.hpp @@ -19,14 +19,14 @@ #pragma once #include -#include #include #include -#include "../utils/socket.hpp" +#include "../utils/socketcan.hpp" class can_bus_t; class can_message_t; +class can_signal_t; /// @brief Object representing a can device. Handle opening, closing and reading on the /// socket. This is the low level object to be initialized and use by can_bus_t. @@ -36,9 +36,7 @@ private: std::string device_name_; ///< a string identifier identitfying the linux CAN device. utils::socketcan_t can_socket_; - int32_t address_; ///< an identifier used through binding that refer to that device - - bool is_fdmode_on_; ///< boolean telling if whether or not the can socket use fdmode. + int index_; std::thread th_reading_; ///< Thread handling read the socket can device filling can_message_q_ queue of can_bus_t bool is_running_ = false; ///< boolean telling whether or not reading is running or not @@ -48,9 +46,10 @@ public: can_bus_dev_t(const std::string& dev_name, int32_t address); std::string get_device_name() const; - uint32_t get_address() const; + int get_index() const; - int open_raw(); + int open(); + void configure(); int close(); void start_reading(can_bus_t& can_bus); @@ -58,6 +57,7 @@ public: void stop_reading(); can_message_t read(); + int create_rx_filter(const can_signal_t& s); int send(can_message_t& can_msg); bool shims_send(const uint32_t arbitration_id, const uint8_t* data, const uint8_t size);