X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=low-can-binding%2Futils%2Fsocketcan-bcm.hpp;h=4806ac0e6edac3b851caf462df91e4f1a8212c75;hb=24bb25c9f16ecace05b64142493dce596f5a9e37;hp=478a52927bfb561cf965e49c64929845cabdd66a;hpb=ea35eabeadce57e4f5015797fea530c5bb219fff;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 478a5292..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,10 @@ namespace utils using socketcan_t::socketcan_t; virtual int open(std::string device_name); + virtual std::shared_ptr read_message(); + virtual int write_message(message_t& obj); - private: - int connect(const struct sockaddr* addr, socklen_t len); }; - socketcan_bcm_t& operator>>(socketcan_bcm_t& s, can_message_t& cm); - socketcan_bcm_t& operator<<(socketcan_bcm_t& s, const std::vector& obj); - socketcan_bcm_t& operator<<(socketcan_bcm_t& s, const struct bcm_msg& obj); }