fix: test for opened CAN socket.
[apps/agl-service-can-low-level.git] / src / can / can-message.hpp
index 87d5fa5..730e9f9 100644 (file)
@@ -22,7 +22,8 @@
 #include <cstdint>
 #include <linux/can.h>
 
-#include "utils/timer.hpp"
+#include "../utils/timer.hpp"
+#include "can-message-set.hpp"
 
 #define CAN_MESSAGE_SIZE 8
 
@@ -69,7 +70,7 @@ public:
 
        bool is_correct_to_send();
 
-static can_message_t convert_to_canfd_frame(const struct canfd_frame& frame, size_t nbytes);
+static can_message_t convert_from_canfd_frame(const struct canfd_frame& frame, size_t nbytes);
        canfd_frame convert_to_canfd_frame();
 };
 
@@ -86,7 +87,7 @@ class can_message_definition_t
        can_bus_dev_t& bus_; /*!< bus_ - A pointer to the bus this message is on. */
        uint32_t id_; /*!< id_ - The ID of the message.*/
        can_message_format_t format_; /*!< format_ - the format of the message's ID.*/
-       FrequencyClock clock_; /*!<  clock_ - an optional frequency clock to control the output of this
+       frequency_clock_t clock_; /*!<  clock_ - an optional frequency clock to control the output of this
                                                        *      message, if sent raw, or simply to mark the max frequency for custom
                                                        *      handlers to retrieve.*/
        bool force_send_changed_; /*!< force_send_changed_ - If true, regardless of the frequency, it will send CAN
@@ -100,27 +101,6 @@ class can_message_definition_t
                uint32_t get_id() const;
 };
 
-/**
- * @class can_message_set_t
- *
- * @brief A parent wrapper for a particular set of CAN messages and associated
- *     CAN buses(e.g. a vehicle or program).
- */
-class can_message_set_t
-{
-       private:
-               uint8_t index_; /*!<index_ - A numerical ID for the message set, ideally the index in an array
-                                               *       for fast lookup*/
-               const std::string name_; /*!< name_ - The name of the message set.*/
-               uint8_t can_bus_count_; /*!< can_bus_count_ - The number of CAN buses defined for this message set.*/
-               unsigned short can_message_count_; /*!< can_message_count_ - The number of CAN messages (across all buses) defined for
-                                                                               *       this message set.*/
-               unsigned short can_signal_count_; /*!< can_signal_count_ - The number of CAN signals (across all messages) defined for
-                                                                       *       this message set.*/
-               unsigned short can_command_count_; /*!< can_command_count_ - The number of CanCommmands defined for this message set.*/
-               unsigned short obd2_signal_count_; /*!< obd2_signal_count_ - The number of obd2 signals defined for this message set.*/
-};
-
 /** Public: Retrive a list of all possible CAN configurations.
  *
  * Returns a pointer to an array of all configurations.