From 1f4eb8c5562bf5c0bc6ebd1b35977cd71d9b3a83 Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Wed, 31 May 2017 12:46:02 +0200 Subject: Reworked subscription to integrate filtering. - Creation of an object which old the subscription context (filter, signal) : low_can_subscription_t - Move socket from can_signal_t to this new object. - Adding a member to can_message_t to transport subscription_id to be able to retrieve it with all the context through running. Change-Id: I87be8cd6c3c93a81040357920d8c081a316800c3 Signed-off-by: Romain Forlot --- CAN-binder/low-can-binding/can/can-message.cpp | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'CAN-binder/low-can-binding/can/can-message.cpp') diff --git a/CAN-binder/low-can-binding/can/can-message.cpp b/CAN-binder/low-can-binding/can/can-message.cpp index abfbfdb..9389494 100644 --- a/CAN-binder/low-can-binding/can/can-message.cpp +++ b/CAN-binder/low-can-binding/can/can-message.cpp @@ -27,7 +27,14 @@ /// Constructor about can_message_t class. /// can_message_t::can_message_t() - : maxdlen_{0}, id_{0}, length_{0}, format_{can_message_format_t::INVALID}, rtr_flag_{false}, flags_{0}, timestamp_{0} + : maxdlen_{0}, + id_{0}, + length_{0}, + format_{can_message_format_t::INVALID}, + rtr_flag_{false}, + flags_{0}, + timestamp_{0}, + sub_id_{-1} {} can_message_t::can_message_t(uint8_t maxdlen, @@ -45,7 +52,8 @@ can_message_t::can_message_t(uint8_t maxdlen, rtr_flag_{rtr_flag}, flags_{flags}, data_{data}, - timestamp_{timestamp} + timestamp_{timestamp}, + sub_id_{-1} {} /// @@ -58,6 +66,11 @@ uint32_t can_message_t::get_id() const return id_; } +int can_message_t::get_sub_id() const +{ + return sub_id_; +} + /// /// @brief Retrieve RTR flag member. /// @@ -121,6 +134,11 @@ uint8_t can_message_t::get_length() const return length_; } +void can_message_t::set_sub_id(int sub_id) +{ + sub_id_ = sub_id; +} + uint64_t can_message_t::get_timestamp() const { return timestamp_; -- cgit 1.2.3-korg