From d2d2620bbb8f0aad0181e67e9f6affc3d6cb4a51 Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Wed, 26 Jun 2019 10:34:04 +0200 Subject: Change can_message_t class usage for new j1939 This commit transforms the class can_message_t as the base class and creates two derived classes: j1939_message_t and can_message_t. Bug-AGL: SPEC-2386 Change-Id: I6d3afd8e4f5abff2cd0ec4e9910bd52a2893de76 Signed-off-by: Arthur Guyader Signed-off-by: Stephane Desneux Signed-off-by: Romain Forlot --- low-can-binding/utils/socketcan-bcm.hpp | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) (limited to 'low-can-binding/utils/socketcan-bcm.hpp') diff --git a/low-can-binding/utils/socketcan-bcm.hpp b/low-can-binding/utils/socketcan-bcm.hpp index 00028905..5e86aa4f 100644 --- a/low-can-binding/utils/socketcan-bcm.hpp +++ b/low-can-binding/utils/socketcan-bcm.hpp @@ -18,21 +18,10 @@ #pragma once #include "socketcan.hpp" -#include "../can/can-message.hpp" - -#define MAX_BCM_CAN_FRAMES 257 +#include "../can/message/can-message.hpp" namespace utils { - struct bcm_msg - { - struct bcm_msg_head msg_head; - union { - struct canfd_frame fd_frames[MAX_BCM_CAN_FRAMES]; - struct can_frame frames[MAX_BCM_CAN_FRAMES]; - }; - }; - /// @brief derivated socketcan class specialized for BCM CAN socket.make_bcm_head class socketcan_bcm_t : public socketcan_t { @@ -40,10 +29,9 @@ namespace utils using socketcan_t::socketcan_t; virtual int open(std::string device_name); - virtual std::shared_ptr read_message(); - virtual void write_message(std::vector>& vobj); - virtual void write_message(std::shared_ptr obj); - void write_message(struct bcm_msg& obj); + virtual std::shared_ptr read_message(); + virtual void write_message(std::vector>& vobj); + virtual void write_message(std::shared_ptr obj); private: int connect(const struct sockaddr* addr, socklen_t len); -- cgit 1.2.3-korg