From 913ac4ead2a8140db8607cef8b216ca997b8401e Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Tue, 21 Feb 2017 08:15:58 +0000 Subject: Fixed can bus class (almost) Change-Id: Icb76d26749e0e7b5f122676861ed09ac0c03be30 Signed-off-by: Romain Forlot --- src/can-utils.hpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/can-utils.hpp') diff --git a/src/can-utils.hpp b/src/can-utils.hpp index d1310a6..ea116b7 100644 --- a/src/can-utils.hpp +++ b/src/can-utils.hpp @@ -29,6 +29,7 @@ #include #include #include +#include #include #include "timer.hpp" @@ -115,13 +116,15 @@ typedef struct CanMessage CanMessage; */ class can_message_t { private: - const struct afb_binding_interface *interface_; + const struct afb_binding_interface* interface_; uint32_t id_; CanMessageFormat format_; uint8_t data_[CAN_MESSAGE_SIZE]; uint8_t length_; public: + can_message_t(const struct afb_binding_interface* interface); + uint32_t get_id() const; int get_format() const; uint8_t get_data() const; @@ -167,6 +170,8 @@ class can_bus_dev_t { can_message_t next_can_message(); void push_new_can_message(const can_message_t& can_msg); bool has_can_message() const; + + int send_can_message(can_message_t& can_msg, const struct afb_binding_interface* interface); }; /** @@ -193,9 +198,7 @@ class can_bus_t { void start_threads(); - int send_can_message(can_message_t can_msg); - - openxc_VehicleMessage& next_vehicle_message(); + openxc_VehicleMessage next_vehicle_message(); void push_new_vehicle_message(const openxc_VehicleMessage& v_msg); bool has_vehicle_message() const; }; -- cgit 1.2.3-korg