+/**
+ * @brief: Get a can_message_t from can_message_q and return it
+ * then point to the next can_message_t in queue.
+ *
+ * @return the next queue element or NULL if queue is empty.
+ */
+can_message_t can_bus_t::next_can_message()
+{
+ can_message_t can_msg(interface_);
+
+ if(!can_message_q_.empty())
+ {
+ can_msg = can_message_q_.front();
+ can_message_q_.pop();
+ DEBUG(interface_, "next_can_message: Here is the next can message : id %d, length %d", can_msg.get_id(), can_msg.get_length());
+ return can_msg;
+ }
+
+ NOTICE(interface_, "next_can_message: End of can message queue");
+ has_can_message_ = false;
+ return can_msg;
+}
+
+/**
+ * @brief Append a new element to the can message queue and set
+ * has_can_message_ boolean to true
+ *
+ * @params[const can_message_t& can_msg] the can_message_t to append
+ *
+ */
+void can_bus_t::push_new_can_message(const can_message_t& can_msg)
+{
+ can_message_q_.push(can_msg);
+}
+
+/**
+ * @brief Flag that let you know when can message queue is exhausted
+ *
+ * @return[bool] has_can_message_ bool
+ */
+bool can_bus_t::has_can_message() const
+{
+ return has_can_message_;
+}
+