aboutsummaryrefslogtreecommitdiffstats
path: root/src/can
diff options
context:
space:
mode:
Diffstat (limited to 'src/can')
-rw-r--r--src/can/can-bus.hpp2
-rw-r--r--src/can/can-command.hpp16
-rw-r--r--src/can/can-message.cpp34
-rw-r--r--src/can/can-message.hpp28
-rw-r--r--src/can/can-signals.cpp4
-rw-r--r--src/can/can-signals.hpp44
6 files changed, 64 insertions, 64 deletions
diff --git a/src/can/can-bus.hpp b/src/can/can-bus.hpp
index 308d83b2..797b8957 100644
--- a/src/can/can-bus.hpp
+++ b/src/can/can-bus.hpp
@@ -81,7 +81,7 @@ public:
void stop_threads();
can_message_t next_can_message();
- void push_new_can_message(const can_message_t& can_msg);
+ void push_new_can_message(const can_message_t& can_msg);
std::mutex& get_can_message_mutex();
std::condition_variable& get_new_can_message_cv();
diff --git a/src/can/can-command.hpp b/src/can/can-command.hpp
index 62b56c1e..a11c2b99 100644
--- a/src/can/can-command.hpp
+++ b/src/can/can-command.hpp
@@ -23,13 +23,13 @@
/**
* @brief The type signature for a function to handle a custom OpenXC command.
*
- * @param[in] char* name - the name of the received command.
- * @param[in] openxc_DynamicField* value - the value of the received command, in a DynamicField. The actual type
+ * @param[in] name - the name of the received command.
+ * @param[in] value - the value of the received command, in a DynamicField. The actual type
* may be a number, string or bool.
- * @param[in] openxc_DynamicField* event - an optional event from the received command, in a DynamicField. The
+ * @param[in] event - an optional event from the received command, in a DynamicField. The
* actual type may be a number, string or bool.
- * @param[in] CanSignal* signals - The list of all signals.
- * @param[in] int signalCount - The length of the signals array.
+ * @param[in] signals - The list of all signals.
+ * @param[in] signalCount - The length of the signals array.
*/
typedef void (*CommandHandler)(const char* name, openxc_DynamicField* value,
openxc_DynamicField* event, CanSignal* signals, int signalCount);
@@ -51,15 +51,15 @@ typedef void (*CommandHandler)(const char* name, openxc_DynamicField* value,
typedef struct {
const char* generic_name; /*!< generic_name - The name of the command.*/
CommandHandler handler; /*!< handler - An function to process the received command's data and perform some
- * action.*/
+ * action.*/
} CanCommand;
/* Public: Return an array of all OpenXC CAN commands enabled in the active
* configuration that can write back to CAN with a custom handler.
*
- * * Commands not defined here are handled using a 1-1 mapping from the signals
+ * Commands not defined here are handled using a 1-1 mapping from the signals
* list.
- * */
+ */
CanCommand* getCommands();
/* Public: Return the length of the array returned by getCommandCount(). */
diff --git a/src/can/can-message.cpp b/src/can/can-message.cpp
index 71e48792..68279e2d 100644
--- a/src/can/can-message.cpp
+++ b/src/can/can-message.cpp
@@ -38,7 +38,7 @@ can_message_t::can_message_t()
/**
* @brief Retrieve id_ member value.
*
-* @return uint32_t id_ class member
+* @return id_ class member
*/
uint32_t can_message_t::get_id() const
{
@@ -48,7 +48,7 @@ uint32_t can_message_t::get_id() const
/**
* @brief Retrieve RTR flag member.
*
-* @return bool rtr_flags_ class member
+* @return rtr_flags_ class member
*/
bool can_message_t::get_rtr_flag_() const
{
@@ -58,7 +58,7 @@ bool can_message_t::get_rtr_flag_() const
/**
* @brief Retrieve format_ member value.
*
-* @return CanMessageFormat format_ class member
+* @return format_ class member
*/
int can_message_t::get_format() const
{
@@ -68,9 +68,9 @@ int can_message_t::get_format() const
}
/**
-* @brief Retrieve format_ member value.
+* @brief Retrieve flags_ member value.
*
-* @return CanMessageFormat format_ class member
+* @return flags_ class member
*/
uint8_t can_message_t::get_flags() const
{
@@ -80,7 +80,7 @@ uint8_t can_message_t::get_flags() const
/**
* @brief Retrieve data_ member value.
*
-* @return uint8_t data_ pointer to the first element
+* @return pointer to the first element
* of class member data_
*/
const uint8_t* can_message_t::get_data() const
@@ -91,7 +91,7 @@ const uint8_t* can_message_t::get_data() const
/**
* @brief Retrieve length_ member value.
*
-* @return uint8_t length_ class member
+* @return length_ class member
*/
uint8_t can_message_t::get_length() const
{
@@ -122,7 +122,7 @@ void can_message_t::set_max_data_length(size_t nbytes)
* @brief Control whether the object is correctly initialized
* to be sent over the CAN bus
*
-* @return true if object correctly initialized and false if not...
+* @return true if object correctly initialized and false if not.
*/
bool can_message_t::is_correct_to_send()
{
@@ -142,7 +142,7 @@ bool can_message_t::is_correct_to_send()
* Preferred way to initialize these members by using
* convert_from_canfd_frame method.
*
-* @param uint32_t id_ class member
+* @param[in] id_ class member
*/
void can_message_t::set_id_and_format(const uint32_t new_id)
{
@@ -170,7 +170,7 @@ void can_message_t::set_id_and_format(const uint32_t new_id)
* Preferred way to initialize these members by using
* convert_from_canfd_frame method.
*
-* @param CanMessageFormat format_ class member
+* @param[in] new_format - class member
*/
void can_message_t::set_format(const CanMessageFormat new_format)
{
@@ -181,13 +181,13 @@ void can_message_t::set_format(const CanMessageFormat new_format)
}
/**
-* @brief Set format_ member value. Deducing from the can_id
+* @brief Set format_ member value. Deduced from the can_id
* of a canfd_frame.
*
* Preferred way to initialize these members by using
* convert_from_canfd_frame method.
*
-* @param uint32_t can_id integer from a canfd_frame
+* @param[in] can_id - integer from a canfd_frame
*/
void can_message_t::set_format(const uint32_t can_id)
{
@@ -205,7 +205,7 @@ void can_message_t::set_format(const uint32_t can_id)
* Preferred way to initialize these members by using
* convert_from_canfd_frame method.
*
-* @param CanMessageFormat format_ class member
+* @param[in] format_ - class member
*/
void can_message_t::set_flags(const uint8_t flags)
{
@@ -218,7 +218,7 @@ void can_message_t::set_flags(const uint8_t flags)
* Preferred way to initialize these members by using
* convert_from_canfd_frame method.
*
-* @param uint8_t length_ array with a max size of 8 elements.
+* @param[in] new_length - array with a max size of 8 elements.
*/
void can_message_t::set_length(const uint8_t new_length)
{
@@ -236,7 +236,7 @@ void can_message_t::set_length(const uint8_t new_length)
* Preferred way to initialize these members by using
* convert_from_canfd_frame method.
*
-* @param uint8_t data_ array with a max size of 8 elements.
+* @param[in] new_data - array with a max size of 8 elements.
*/
void can_message_t::set_data(const __u8* new_data)
{
@@ -255,9 +255,9 @@ void can_message_t::set_data(const __u8* new_data)
*
* This is the preferred way to initialize class members.
*
-* @param canfd_frame struct read from can bus device.
+* @param[in] args - struct read from can bus device.
*/
-void can_message_t::convert_from_canfd_frame(const std::pair<struct canfd_frame&, size_t>args)
+void can_message_t::convert_from_canfd_frame(const std::pair<struct canfd_frame&, size_t> args)
{
// May be it's overkill to assign member of the pair... May be it will change...
struct canfd_frame frame = args.first;
diff --git a/src/can/can-message.hpp b/src/can/can-message.hpp
index af1f0502..b88a1770 100644
--- a/src/can/can-message.hpp
+++ b/src/can/can-message.hpp
@@ -58,14 +58,14 @@ typedef struct CanMessage CanMessage;
*/
class can_message_t {
private:
- uint32_t id_; /*!< uint32_t id - The ID of the message. */
- bool rtr_flag_; /*!< bool rtr_flag - Telling if the frame has RTR flag positionned. Then frame hasn't data field*/
- uint8_t length_; /*!< uint8_t length - the length of the data array (max 8). */
- uint8_t flags_; /*!< unint8_t flags of a CAN FD frame. Needed if we catch FD frames.*/
- CanMessageFormat format_; /*!< CanMessageFormat format - the format of the message's ID.*/
- std::vector<uint8_t> data_; /*!< uint8_t data - The message's data field with a size of 8 which is the standard about CAN bus messages.*/
+ uint32_t id_; /*!< id_ - The ID of the message. */
+ bool rtr_flag_; /*!< rtr_flag_ - Telling if the frame has RTR flag positionned. Then frame hasn't data field*/
+ uint8_t length_; /*!< length_ - the length of the data array (max 8). */
+ uint8_t flags_; /*!< flags_ - flags of a CAN FD frame. Needed if we catch FD frames.*/
+ CanMessageFormat format_; /*!< format_ - the format of the message's ID.*/
+ std::vector<uint8_t> data_; /*!< data_ - The message's data field with a size of 8 which is the standard about CAN bus messages.*/
- uint8_t maxdlen_;
+ uint8_t maxdlen_; /*!< maxdlen_ - Max data length deduce from number of bytes read from the socket.*/
public:
can_message_t();
@@ -153,16 +153,16 @@ class can_message_definition_t
class can_message_set_t
{
private:
- uint8_t index; /*!<index - A numerical ID for the message set, ideally the index in an array
+ 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; /*!< busCount - The number of CAN buses defined for this message set.*/
- unsigned short can_message_count; /*!< messageCount - The number of CAN messages (across all buses) defined for
+ 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; /*!< signalCount - The number of CAN signals (across all messages) defined for
+ 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; /*!< commandCount - The number of CanCommmands defined for this message set.*/
- unsigned short obd2_signal_count; /*!< commandCount - The number of obd2 signals 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: Return the currently active CAN configuration. */
diff --git a/src/can/can-signals.cpp b/src/can/can-signals.cpp
index bbd172b2..18f5f2aa 100644
--- a/src/can/can-signals.cpp
+++ b/src/can/can-signals.cpp
@@ -28,9 +28,9 @@
* @fn void find_can_signals(const openxc_DynamicField& key, std::vector<CanSignal*>& found_signals)
* @brief return signals name found searching through CAN_signals and OBD2 pid
*
- * @param[in] const openxc_DynamicField : can contain numeric or string value in order to search against
+ * @param[in] key - can contain numeric or string value in order to search against
* can signals or obd2 signals name.
- * @param[out] std::vector<CanSignal*>& found_signals : provided vector to fill with ponter to signals matched.
+ * @param[out] found_signals - provided vector to fill with ponter to signals matched.
*
*/
void find_can_signals(const openxc_DynamicField& key, std::vector<CanSignal*>& found_signals)
diff --git a/src/can/can-signals.hpp b/src/can/can-signals.hpp
index 2bc77b09..d4b22ccc 100644
--- a/src/can/can-signals.hpp
+++ b/src/can/can-signals.hpp
@@ -43,12 +43,12 @@ extern "C"
* @desc A SignalDecoder transforms a raw floating point CAN signal into a number,
* string or boolean.
*
- * @param[in] CanSignal signal - The CAN signal that we are decoding.
- * @param[in] CanSignal signals - The list of all signals.
- * @param[in] int signalCount - The length of the signals array.
- * @param[in] float value - The CAN signal parsed from the message as a raw floating point
+ * @param[in] signal - The CAN signal that we are decoding.
+ * @param[in] signals - The list of all signals.
+ * @param[in] signalCount - The length of the signals array.
+ * @param[in] value - The CAN signal parsed from the message as a raw floating point
* value.
- * @param[out] bool send - An output parameter. If the decoding failed or the CAN signal should
+ * @param[out] send - An output parameter. If the decoding failed or the CAN signal should
* not send for some other reason, this should be flipped to false.
*
* @return a decoded value in an openxc_DynamicField struct.
@@ -62,9 +62,9 @@ typedef openxc_DynamicField (*SignalDecoder)(struct CanSignal& signal,
* @desc A SignalEncoder transforms a number, string or boolean into a raw floating
* point value that fits in the CAN signal.
*
- * @params[signal] - The CAN signal to encode.
- * @params[value] - The dynamic field to encode.
- * @params[send] - An output parameter. If the encoding failed or the CAN signal should
+ * @params[in] signal - The CAN signal to encode.
+ * @params[in] value - The dynamic field to encode.
+ * @params send - An output parameter. If the encoding failed or the CAN signal should
* not be encoded for some other reason, this will be flipped to false.
*/
typedef uint64_t (*SignalEncoder)(struct CanSignal* signal,
@@ -77,8 +77,8 @@ typedef uint64_t (*SignalEncoder)(struct CanSignal* signal,
* OpenXC state names.
*/
struct CanSignalState {
- const int value; /*!< int value - The integer value of the state on the CAN bus.*/
- const char* name; /*!< char* name - The corresponding string name for the state in OpenXC. */
+ const int value; /*!< value - The integer value of the state on the CAN bus.*/
+ const char* name; /*!< name - The corresponding string name for the state in OpenXC. */
};
typedef struct CanSignalState CanSignalState;
@@ -88,7 +88,7 @@ typedef struct CanSignalState CanSignalState;
* @brief A CAN signal to decode from the bus and output over USB.
*/
struct CanSignal {
- struct CanMessageDefinition* message; /*!< message - The message this signal is a part of. */
+ struct CanMessageDefinition* message; /*!< message - The message this signal is a part of. */
const char* generic_name; /*!< generic_name - The name of the signal to be output over USB.*/
uint8_t bitPosition; /*!< bitPosition - The starting bit of the signal in its CAN message (assuming
* non-inverted bit numbering, i.e. the most significant bit of
@@ -125,23 +125,23 @@ typedef struct CanSignal CanSignal;
class can_signal_t
{
private:
- struct can_message_definition_t* message_; /*!< message - The message this signal is a part of. */
- const std::string generic_name_; /*!< generic_name - The name of the signal to be output over USB.*/
- uint8_t bitPosition_; /*!< bitPosition - The starting bit of the signal in its CAN message (assuming
+ struct can_message_definition_t* message_; /*!< message_ - The message this signal is a part of. */
+ const std::string generic_name_; /*!< generic_name_ - The name of the signal to be output over USB.*/
+ uint8_t bitPosition_; /*!< bitPosition_ - The starting bit of the signal in its CAN message (assuming
* non-inverted bit numbering, i.e. the most significant bit of
* each byte is 0) */
- uint8_t bitSize_; /*!< bitSize - The width of the bit field in the CAN message. */
- float factor_; /*!< factor - The final value will be multiplied by this factor. Use 1 if you
+ uint8_t bitSize_; /*!< bitSize_ - The width of the bit field in the CAN message. */
+ float factor_; /*!< factor_ - The final value will be multiplied by this factor. Use 1 if you
* don't need a factor. */
- float offset_; /*!< offset - The final value will be added to this offset. Use 0 if you
+ float offset_; /*!< offset_ - The final value will be added to this offset. Use 0 if you
* don't need an offset. */
- float min_value_; /*!< minValue - The minimum value for the processed signal.*/
- float max_value_; /*!< maxValue - The maximum value for the processed signal. */
- FrequencyClock clock_; /*!< clock_ - A FrequencyClock struct to control the maximum frequency to
+ float min_value_; /*!< min_value_ - The minimum value for the processed signal.*/
+ float max_value_; /*!< max_value_ - The maximum value for the processed signal. */
+ FrequencyClock frequency_; /*!< frequency_ - A FrequencyClock struct to control the maximum frequency to
* process and send this signal. To process every value, set the
* clock's frequency to 0. */
- bool sendSame_; /*!< sendSame - If true, will re-send even if the value hasn't changed.*/
- bool forceSendChanged_; /*!< forceSendChanged - If true, regardless of the frequency, it will send the
+ bool send_same_; /*!< send_same_ - If true, will re-send even if the value hasn't changed.*/
+ bool force_send_changed_; /*!< force_send_changed_ - If true, regardless of the frequency, it will send the
* value if it has changed. */
const std::map<const int, const std::string> states_; /*!< states_ - A map of CAN signal state describing the mapping
* between numerical and string values for valid states. */