-/**
- * @brief Object representing a can device. Handle opening, closing and reading on the
- * socket. This is the low level object to be use by can_bus_t.
- *
- * @params[in] std::string device_name_ - name of the linux device handling the can bus. Generally vcan0, can0, etc.
- */
-class can_bus_dev_t {
- private:
- std::string device_name_;
- int can_socket_;
- bool is_fdmode_on_;
- struct sockaddr_can txAddress_;
-
- bool has_can_message_;
- std::queue <can_message_t> can_message_q_;
-
- std::thread th_reading_;
- bool is_running_;
-
- public:
- can_bus_dev_t(const std::string& dev_name);
-
- int open(const struct afb_binding_interface* interface);
- int close();
- bool is_running();
- void start_reading();
- canfd_frame read(const struct afb_binding_interface *interface);
-
- can_message_t next_can_message();
- void push_new_can_message(const can_message_t& can_msg);
- bool has_can_message() const;
-};
-