X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=low-can-binding%2Futils%2Fsocketcan-bcm.hpp;h=4806ac0e6edac3b851caf462df91e4f1a8212c75;hb=0c3b1aa689131736110dcee346dc6a87f156bde9;hp=000289053140dd99ba164c410f99a18c78bfbf0e;hpb=a6fb72a70f90c35e0968f2460d324a8505410562;p=apps%2Fagl-service-can-low-level.git diff --git a/low-can-binding/utils/socketcan-bcm.hpp b/low-can-binding/utils/socketcan-bcm.hpp index 00028905..4806ac0e 100644 --- a/low-can-binding/utils/socketcan-bcm.hpp +++ b/low-can-binding/utils/socketcan-bcm.hpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015, 2016 ,2017 "IoT.bzh" + * Copyright (C) 2015, 2016 , 2017, 2018, 2019 "IoT\.bzh" * Author "Romain Forlot" * Author "Loïc Collignon" * Licensed under the Apache License, Version 2.0 (the "License"); @@ -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,13 +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 int write_message(message_t& obj); - private: - int connect(const struct sockaddr* addr, socklen_t len); };