aboutsummaryrefslogtreecommitdiffstats
path: root/CAN-binder
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-05-31 12:08:13 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2017-06-01 18:26:18 +0200
commit862a59747245529ae2b6039a00b639e747069aae (patch)
tree2c2f9c11cec7423efce8415982458d16f77a7a44 /CAN-binder
parent48e2e51bae1b71a0ae0d214ed8c165c6113c6b61 (diff)
Clearer call to method
Change-Id: Ibf37a46989ac8d84a56aa43873fdb8bb0e601304 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'CAN-binder')
-rw-r--r--CAN-binder/low-can-binding/can/can-bus.cpp8
-rw-r--r--CAN-binder/low-can-binding/can/can-bus.hpp2
2 files changed, 5 insertions, 5 deletions
diff --git a/CAN-binder/low-can-binding/can/can-bus.cpp b/CAN-binder/low-can-binding/can/can-bus.cpp
index d83ef5d..4113107 100644
--- a/CAN-binder/low-can-binding/can/can-bus.cpp
+++ b/CAN-binder/low-can-binding/can/can-bus.cpp
@@ -82,8 +82,8 @@ int can_bus_t::process_can_signals(const can_message_t& can_message)
openxc_SimpleMessage s_message = build_SimpleMessage(sig->get_sig_name(), decoded_message);
vehicle_message = build_VehicleMessage(s_message, can_message.get_timestamp());
- push_new_vehicle_message(std::make_pair(can_message.get_sub_id(), vehicle_message));
std::lock_guard<std::mutex> decoded_can_message_lock(decoded_can_message_mutex_);
+ push_new_vehicle_message(subscription_id, vehicle_message);
}
processed_signals++;
}
@@ -116,7 +116,7 @@ int can_bus_t::process_diagnostic_signals(diagnostic_manager_t& manager, const c
(s.find(can_message.get_sub_id()) != s.end() && afb_event_is_valid(s[can_message.get_sub_id()].second)))
{
std::lock_guard<std::mutex> decoded_can_message_lock(decoded_can_message_mutex_);
- push_new_vehicle_message(std::make_pair(can_message.get_sub_id(), vehicle_message));
+ push_new_vehicle_message(can_message.get_sub_id(), vehicle_message);
processed_signals++;
}
}
@@ -277,9 +277,9 @@ std::pair<int, openxc_VehicleMessage> can_bus_t::next_vehicle_message()
/// @brief Push a openxc_VehicleMessage into the queue
///
/// @param[in] v_msg - const reference openxc_VehicleMessage object to push into the queue
-void can_bus_t::push_new_vehicle_message(const std::pair<int, openxc_VehicleMessage>& v_msg)
+void can_bus_t::push_new_vehicle_message(int subscription_id, const openxc_VehicleMessage& v_msg)
{
- vehicle_message_q_.push(v_msg);
+ vehicle_message_q_.push(std::make_pair(subscription_id, v_msg));
}
/// @brief Return the shared pointer on the can_bus_dev_t initialized
diff --git a/CAN-binder/low-can-binding/can/can-bus.hpp b/CAN-binder/low-can-binding/can/can-bus.hpp
index 934b45d..1d064b2 100644
--- a/CAN-binder/low-can-binding/can/can-bus.hpp
+++ b/CAN-binder/low-can-binding/can/can-bus.hpp
@@ -88,5 +88,5 @@ public:
std::condition_variable& get_new_can_message_cv();
std::pair<int, openxc_VehicleMessage> next_vehicle_message();
- void push_new_vehicle_message(const std::pair<int, openxc_VehicleMessage>& v_msg);
+ void push_new_vehicle_message(int subscription_id, const openxc_VehicleMessage& v_msg);
};