aboutsummaryrefslogtreecommitdiffstats
path: root/CAN-binder/low-can-binding/can/can-signals.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'CAN-binder/low-can-binding/can/can-signals.cpp')
-rw-r--r--CAN-binder/low-can-binding/can/can-signals.cpp11
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 48c919da..c8098a51 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