diff options
author | Romain Forlot <romain.forlot@iot.bzh> | 2017-05-05 18:35:53 +0200 |
---|---|---|
committer | Romain Forlot <romain.forlot@iot.bzh> | 2017-05-05 18:42:30 +0200 |
commit | 3d3fbfd56b476a1f36bfc9cabf5a21f981d06844 (patch) | |
tree | 6d3271ea05f35ba969b3ed2a264540c27cc891b5 /CAN-binder/low-can-binding/can/can-signals.cpp | |
parent | 5b66a43147af37f4ebe3429eb045900aa7323613 (diff) |
Get back to device dedicated raw_socket
Change-Id: Ibec47106f8510e92a017fc08aeb2eeaeef2884e5
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'CAN-binder/low-can-binding/can/can-signals.cpp')
-rw-r--r-- | CAN-binder/low-can-binding/can/can-signals.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/CAN-binder/low-can-binding/can/can-signals.cpp b/CAN-binder/low-can-binding/can/can-signals.cpp index 48c919d..c8098a5 100644 --- a/CAN-binder/low-can-binding/can/can-signals.cpp +++ b/CAN-binder/low-can-binding/can/can-signals.cpp @@ -235,3 +235,14 @@ int can_signal_t::create_rx_filter() return -1; } +can_message_format_t can_signal_t::read_socket() +{ + can_message_t msg; + can_bus_t& cbm = configuration_t::instance().get_can_bus_manager(); + socket_ >> msg; + std::lock_guard<std::mutex> can_message_lock(cbm.get_can_message_mutex()); + { cbm.push_new_can_message(msg); } + cbm.get_new_can_message_cv().notify_one(); + + return msg.get_format(); +}
\ No newline at end of file |