From b0975e4bfa534153657a7ee8acaee0f950056e97 Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Thu, 23 Feb 2017 10:32:17 +0000 Subject: Cleaning, improve comments Change-Id: I2115f7e7017786c343da4b70002c3b3785ba53ac Signed-off-by: Romain Forlot --- src/CMakeLists.txt | 1 - src/can-signals.hpp | 2 +- src/can-utils.hpp | 100 +++++++++++++++++++++++------------------------- src/low-can-binding.cpp | 4 +- 4 files changed, 50 insertions(+), 57 deletions(-) (limited to 'src') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 8fd38ec7..e1a82ffc 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -67,7 +67,6 @@ link_libraries(${EXTRAS_LIBRARIES}) message(STATUS "Creation of ${PROJECT_NAME} binding for AFB-DAEMON") ########################################################################### add_library(${PROJECT_NAME}-binding MODULE ${PROJECT_NAME}-binding.cpp can-signals.cpp can-utils.cpp can_reader.cpp can_decode_message.cpp can_event_push.cpp openxc-utils.cpp timer.cpp) -#add_library(${PROJECT_NAME}-binding MODULE ${PROJECT_NAME}-binding.cpp can-signals.cpp can-utils.cpp obd2.cpp) set_target_properties(${PROJECT_NAME}-binding PROPERTIES PREFIX "" diff --git a/src/can-signals.hpp b/src/can-signals.hpp index e0fe2230..374afeea 100644 --- a/src/can-signals.hpp +++ b/src/can-signals.hpp @@ -17,11 +17,11 @@ #pragma once +#include #include #include #include #include -#include #include "can-utils.hpp" diff --git a/src/can-utils.hpp b/src/can-utils.hpp index 4252b978..4d41f211 100644 --- a/src/can-utils.hpp +++ b/src/can-utils.hpp @@ -38,7 +38,6 @@ extern "C" { #include - #include } // TODO actual max is 32 but dropped to 24 for memory considerations @@ -440,53 +439,43 @@ struct CanSignal { typedef struct CanSignal CanSignal; /** + * @struct CanMessageDefinition + * * @brief The definition of a CAN message. This includes a lot of metadata, so * to save memory this struct should not be used for storing incoming and * outgoing CAN messages. - * - * @param[in] bus - A pointer to the bus this message is on. - * @param[in] id - The ID of the message. - * @param[in] format - the format of the message's ID. - * @param[in] 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 retriec++ if ? syntaxve. - * @param[in] forceSendChanged - If true, regardless of the frequency, it will send CAN - * message if it has changed when using raw passthrough. - * @param[in] lastValue - The last received value of the message. Defaults to undefined. - * This is required for the forceSendChanged functionality, as the stack - * needs to compare an incoming CAN message with the previous frame. */ struct CanMessageDefinition { - struct CanBus* bus; - uint32_t id; - CanMessageFormat format; - FrequencyClock frequencyClock; - bool forceSendChanged; - uint8_t lastValue[CAN_MESSAGE_SIZE]; + struct CanBus* bus; /*!< bus - A pointer to the bus this message is on. */ + uint32_t id; /*!< id - The ID of the message.*/ + CanMessageFormat format; /*!< format - the format of the message's ID.*/ + FrequencyClock frequencyClock; /*!< 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 retriec++ if ? syntaxve.*/ + bool forceSendChanged; /*!< forceSendChanged - If true, regardless of the frequency, it will send CAN + * message if it has changed when using raw passthrough.*/ + uint8_t lastValue[CAN_MESSAGE_SIZE]; /*!< lastValue - The last received value of the message. Defaults to undefined. + * This is required for the forceSendChanged functionality, as the stack + * needs to compare an incoming CAN message with the previous frame.*/ }; typedef struct CanMessageDefinition CanMessageDefinition; /** + * @struct CanMessageSet + * * @brief A parent wrapper for a particular set of CAN messages and associated * CAN buses(e.g. a vehicle or program). - * - * @param[in] index - A numerical ID for the message set, ideally the index in an array - * for fast lookup - * @param[in] name - The name of the message set. - * @param[in] busCount - The number of CAN buses defined for this message set. - * @param[in] messageCount - The number of CAN messages (across all buses) defined for - * this message set. - * @param[in] signalCount - The number of CAN signals (across all messages) defined for - * this message set. - * @param[in] commandCount - The number of CanCommmands defined for this message set. */ typedef struct { - uint8_t index; - const char* name; - uint8_t busCount; - unsigned short messageCount; - unsigned short signalCount; - unsigned short commandCount; + uint8_t index; /*! #include +#include "low-can-binding.hpp" + #include "can-utils.hpp" #include "can-signals.hpp" #include "openxc-utils.hpp" -#include "low-can-binding.hpp" - extern "C" { #include -- cgit 1.2.3-korg