X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=low-can-binding%2Futils%2Fsocketcan-bcm.hpp;h=4806ac0e6edac3b851caf462df91e4f1a8212c75;hb=refs%2Fchanges%2F72%2F23472%2F2;hp=22927cb61325ef8ce1ccbd8c73e6a7996e23bcc9;hpb=6cf79a0f884d2922d82db137c2708f0460e2b43e;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 22927cb6..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,38 +18,21 @@ #pragma once #include "socketcan.hpp" -#include "../can/can-message.hpp" +#include "../can/message/can-message.hpp" namespace utils { - struct simple_bcm_msg - { - struct bcm_msg_head msg_head; - struct can_frame frames; - }; - -#ifdef KERNEL_MINIMAL_VERSION_OK - struct canfd_bcm_msg - { - struct bcm_msg_head msg_head; - struct canfd_frame frames; - canfd_bcm_msg() { msg_head.flags |= CAN_FD_FRAME; } - }; -#endif - - /// @brief derivated socketcan class specialized for BCM CAN socket. + /// @brief derivated socketcan class specialized for BCM CAN socket.make_bcm_head class socketcan_bcm_t : public socketcan_t { public: 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 struct simple_bcm_msg& obj); -// socketcan_bcm_t& operator<<(socketcan_bcm_t& s, const struct canfd_bcm_msg& obj); + }