aboutsummaryrefslogtreecommitdiffstats
path: root/CAN-binder/low-can-binding/can/can-bus.hpp
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-05-31 12:46:02 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2017-06-01 18:22:49 +0200
commit1f4eb8c5562bf5c0bc6ebd1b35977cd71d9b3a83 (patch)
tree0373a64035f894a7b18139306cbf879989d28268 /CAN-binder/low-can-binding/can/can-bus.hpp
parentc28f479a597de89f38b2bbd155afc26c7f2de822 (diff)
Reworked subscription to integrate filtering.
- Creation of an object which old the subscription context (filter, signal) : low_can_subscription_t - Move socket from can_signal_t to this new object. - Adding a member to can_message_t to transport subscription_id to be able to retrieve it with all the context through running. Change-Id: I87be8cd6c3c93a81040357920d8c081a316800c3 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'CAN-binder/low-can-binding/can/can-bus.hpp')
-rw-r--r--CAN-binder/low-can-binding/can/can-bus.hpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/CAN-binder/low-can-binding/can/can-bus.hpp b/CAN-binder/low-can-binding/can/can-bus.hpp
index 16d8cf6a..934b45d5 100644
--- a/CAN-binder/low-can-binding/can/can-bus.hpp
+++ b/CAN-binder/low-can-binding/can/can-bus.hpp
@@ -18,6 +18,7 @@
#pragma once
+#include <utility>
#include <mutex>
#include <queue>
#include <thread>
@@ -67,7 +68,7 @@ private:
std::condition_variable new_decoded_can_message_; ///< condition_variable use to wait until there is a new vehicle message to read from the queue vehicle_message_q_
std::mutex decoded_can_message_mutex_; ///< mutex protecting the vehicle_message_q_ queue.
- std::queue <openxc_VehicleMessage> vehicle_message_q_; ///< queue that'll store openxc_VehicleMessage to pushed
+ std::queue <std::pair<int, openxc_VehicleMessage> > vehicle_message_q_; ///< queue that'll store openxc_VehicleMessage to pushed
std::vector<std::pair<std::string, std::string> > can_devices_;
public:
@@ -81,11 +82,11 @@ public:
void start_threads();
void stop_threads();
- can_message_t next_can_message();
+ const can_message_t next_can_message();
void push_new_can_message(const can_message_t& can_msg);
std::mutex& get_can_message_mutex();
std::condition_variable& get_new_can_message_cv();
- openxc_VehicleMessage next_vehicle_message();
- void push_new_vehicle_message(const openxc_VehicleMessage& v_msg);
+ std::pair<int, openxc_VehicleMessage> next_vehicle_message();
+ void push_new_vehicle_message(const std::pair<int, openxc_VehicleMessage>& v_msg);
};