diff options
Diffstat (limited to 'src/can-utils.cpp')
-rw-r--r-- | src/can-utils.cpp | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/can-utils.cpp b/src/can-utils.cpp index 4646a348..e978cae5 100644 --- a/src/can-utils.cpp +++ b/src/can-utils.cpp @@ -185,8 +185,15 @@ can_message_t* can_bus_t::next_can_message() can_message_q_.pop() return &can_msg; } + has_can_message_ = false; +} - return nullptr; +/** + * @return has_can_message_ bool + */ +bool can_bus_t::has_can_message() const +{ + return has_can_message_; } void can_bus_t::insert_new_can_message(can_message_t &can_msg) @@ -209,13 +216,23 @@ openxc_VehicleMessage* can_bus_t::next_vehicle_message() return &v_msg; } - return nullptr; + has_vehicle_message_ = false; } void can_bus_t::insert_new_vehicle_message(openxc_VehicleMessage *v_msg) { vehicle_message_q_.push(v_msg); + has_vehicle_message_ = true; } + +/* + * Return has_can_message_ bool + */ +bool can_bus_t::has_vehicle_message() const +{ + return has_vehicle_message_; +} + /******************************************************************************** * * CanMessage method implementation |