Cleanup include and prepare to switch binding v2
[apps/agl-service-can-low-level.git] / CAN-binder / low-can-binding / can / can-signals.hpp
index f30d6b3..a56fc8c 100644 (file)
 #include "can-message.hpp"
 #include "../diagnostic/diagnostic-message.hpp"
 
-extern "C"
-{
-       #include <afb/afb-binding.h>
-       #include <afb/afb-event-itf.h>
-}
-
 #define MESSAGE_SET_ID 0
 
 class can_signal_t;
@@ -56,7 +50,7 @@ class can_signal_t;
 /// @return a decoded value in an openxc_DynamicField struct.
 ///
 typedef openxc_DynamicField (*SignalDecoder)(can_signal_t& signal,
-               const std::vector<std::shared_ptr<can_signal_t> > signals, float value, bool* send);
+               const std::vector<std::shared_ptr<can_signal_t> >& 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.*/
@@ -127,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;
@@ -149,11 +141,11 @@ public:
        SignalEncoder& get_encoder();
        bool get_received() const;
        float get_last_value() const;
+       std::pair<float, uint64_t> 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();
+       void set_timestamp(uint64_t timestamp);
 };