diff options
author | Romain Forlot <romain.forlot@iot.bzh> | 2017-07-14 17:30:43 +0200 |
---|---|---|
committer | Romain Forlot <romain.forlot@iot.bzh> | 2017-07-21 12:02:11 +0200 |
commit | a483f245eb1aae07917c9074568c8cda82855ff6 (patch) | |
tree | 55ed7a58911fd615ce9a6ae4d2e1c52c09723b54 /low-can-binding/binding/low-can-socket.hpp | |
parent | 2408a177e8260dcda266df9993e6acd528bebbbc (diff) |
Handle object without signal, only a bus
To be able to send or receive message on bus without depending
upon on a signals, this is adds opening socket just with a bus_name
if provided.
Also handle send a frame on bus depending on a signal or not.
Change-Id: I3a60a03a2d36db4db14b9ae90eefc4bbc8f21e32
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'low-can-binding/binding/low-can-socket.hpp')
-rw-r--r-- | low-can-binding/binding/low-can-socket.hpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/low-can-binding/binding/low-can-socket.hpp b/low-can-binding/binding/low-can-socket.hpp index 3621a3d..018b307 100644 --- a/low-can-binding/binding/low-can-socket.hpp +++ b/low-can-binding/binding/low-can-socket.hpp @@ -80,11 +80,12 @@ public: struct utils::simple_bcm_msg make_bcm_head(uint32_t opcode, uint32_t can_id = 0, uint32_t flags = 0, const struct timeval& timeout = {0,0}, const struct timeval& frequency_thinning = {0,0}) const; void add_bcm_frame(const struct can_frame& cfd, struct utils::simple_bcm_msg& bcm_msg) const; - int open_socket(); + int open_socket(const std::string& bus_name = ""); int create_rx_filter(std::shared_ptr<can_signal_t> sig); int create_rx_filter(std::shared_ptr<diagnostic_message_t> sig); int create_rx_filter(utils::simple_bcm_msg& bcm_msg); - int tx_send(const struct can_frame& cf, std::shared_ptr<can_signal_t> sig = nullptr); + int tx_send(const struct can_frame& cf, std::shared_ptr<can_signal_t> sig); + int tx_send(const struct can_frame& cf, const std::string& bus_name); }; |