summaryrefslogtreecommitdiffstats
path: root/src/can-utils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/can-utils.cpp')
-rw-r--r--src/can-utils.cpp24
1 files changed, 23 insertions, 1 deletions
diff --git a/src/can-utils.cpp b/src/can-utils.cpp
index 09f49476..f10b9689 100644
--- a/src/can-utils.cpp
+++ b/src/can-utils.cpp
@@ -143,7 +143,7 @@ CanMessage_c* CanBus_c::next_can_message()
return &can_msg;
}
- return NULL;
+ return nullptr;
}
void CanBus_c::insert_new_can_message(CanMessage_c *can_msg)
@@ -151,6 +151,28 @@ void CanBus_c::insert_new_can_message(CanMessage_c *can_msg)
can_message_q.push(can_msg);
}
+/*
+ * Get a VehicleMessage from vehicle_message_q and return it
+ * then point to the next VehicleMessage in queue.
+ *
+ * Return the next queue element or NULL if queue is empty.
+ */
+openxc_VehicleMessage* CanBus_c::next_vehicle_message()
+{
+ if(! vehicle_message_q.empty())
+ {
+ openxc_VehicleMessage v_msg = vehicle_message_q.front();
+ vehicle_message_q.pop()
+ return &v_msg;
+ }
+
+ return nullptr;
+}
+
+void CanBus_c::insert_new_vehicle_message(openxc_VehicleMessage *v_msg)
+{
+ vehicle_message_q.push(v_msg);
+}
/********************************************************************************
*
* CanMessage method implementation