X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=CAN-binder%2Flow-can-binding%2Fcan%2Fcan-signals.hpp;h=a56fc8cd03bdb1d6069f472d2f75924472b9874c;hb=5206b26e1a6811d142ffbaf12daaea0731345490;hp=1277bf3623f30261c42ad7e2a8bd0dbd832684e8;hpb=fd3978709abbb3ed46caaf48c1d2f45b2c74fa89;p=apps%2Fagl-service-can-low-level.git diff --git a/CAN-binder/low-can-binding/can/can-signals.hpp b/CAN-binder/low-can-binding/can/can-signals.hpp index 1277bf36..a56fc8cd 100644 --- a/CAN-binder/low-can-binding/can/can-signals.hpp +++ b/CAN-binder/low-can-binding/can/can-signals.hpp @@ -24,21 +24,15 @@ #include #include "openxc.pb.h" +#include "can-message-definition.hpp" #include "../utils/timer.hpp" #include "../utils/socketcan-bcm.hpp" #include "can-message.hpp" #include "../diagnostic/diagnostic-message.hpp" -extern "C" -{ - #include - #include -} - #define MESSAGE_SET_ID 0 class can_signal_t; -class can_message_definition_t; /// /// @brief The type signature for a CAN signal decoder. /// @@ -56,7 +50,7 @@ class can_message_definition_t; /// @return a decoded value in an openxc_DynamicField struct. /// typedef openxc_DynamicField (*SignalDecoder)(can_signal_t& signal, - const std::vector > signals, float value, bool* send); + const std::vector >& signals, float value, bool* send); /// /// @brief: The type signature for a CAN signal encoder. @@ -76,7 +70,6 @@ class can_signal_t { private: can_message_definition_t* parent_; /*!< parent_ - pointer to the parent message definition holding this signal*/ - utils::socketcan_bcm_t socket_; /*!< socket_ - Specific BCM socket that filter the signal read from CAN device */ std::string generic_name_; /*!< generic_name_ - The name of the signal to be output.*/ static std::string prefix_; /*!< prefix_ - generic_name_ will be prefixed with it. It has to reflect the used protocol. * which make easier to sort message when the come in.*/ @@ -110,7 +103,6 @@ private: * this value is undefined. */ public: - //can_signal_t(const can_signal_t& b); can_signal_t( std::string generic_name, uint8_t bit_position, @@ -128,11 +120,10 @@ public: SignalEncoder encoder, bool received); - utils::socketcan_bcm_t get_socket() const; can_message_definition_t* get_message() const; - const std::string& get_generic_name() const; + const std::string get_generic_name() const; const std::string get_name() const; - const std::string& get_prefix() const; + const std::string get_prefix() const; uint8_t get_bit_position() const; uint8_t get_bit_size() const; float get_factor() const; @@ -150,11 +141,11 @@ public: SignalEncoder& get_encoder(); bool get_received() const; float get_last_value() const; + std::pair get_last_value_with_timestamp() const; void set_parent(can_message_definition_t* parent); void set_prefix(std::string val); void set_received(bool r); void set_last_value(float val); - - int create_rx_filter(); -}; \ No newline at end of file + void set_timestamp(uint64_t timestamp); +};