Constructor making mandatory to pass a can_bus_dev_t
authorRomain Forlot <romain.forlot@iot.bzh>
Wed, 8 Mar 2017 23:50:47 +0000 (00:50 +0100)
committerRomain Forlot <romain.forlot@iot.bzh>
Thu, 16 Mar 2017 16:10:40 +0000 (17:10 +0100)
instance to initialize it as it is reference.

Change-Id: I0261a5e2fdca5a84fd736d7ceae837ff9156b935
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
src/can/can-message.cpp
src/can/can-message.hpp

index dd15c06..0053ef4 100644 (file)
@@ -259,8 +259,8 @@ canfd_frame can_message_t::convert_to_canfd_frame()
 *
 *********************************************************************************/
 
-can_message_definition_t::can_message_definition_t()
-       : last_value_(CAN_MESSAGE_SIZE)
+can_message_definition_t::can_message_definition_t(can_bus_dev_t& cbd)
+       : bus_{cbd}, last_value_(CAN_MESSAGE_SIZE)
 {}
 
 uint32_t can_message_definition_t::get_id() const
index 0494f5f..87d5fa5 100644 (file)
@@ -96,7 +96,7 @@ class can_message_definition_t
                                                                                  *     needs to compare an incoming CAN message with the previous frame.*/
        
        public:
-         can_message_definition_t();
+         can_message_definition_t(can_bus_dev_t& cbd);
                uint32_t get_id() const;
 };