diff options
author | Romain Forlot <romain.forlot@iot.bzh> | 2017-03-09 02:25:46 +0100 |
---|---|---|
committer | Romain Forlot <romain.forlot@iot.bzh> | 2017-03-16 17:10:40 +0100 |
commit | f1afeaf50836bf66153cb6cccbfbfdc1e2a5493b (patch) | |
tree | 9b006e190acd372e0f0c9e4bf9c82ce4e5e288a5 /src/can | |
parent | 40acdf8f4ee0ee4127ffb5f092aaf0376763e7ce (diff) |
Typo and formating.
Change-Id: I864a2fe7f974b0f2bf5000f55c2dc71ecf32a314
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'src/can')
-rw-r--r-- | src/can/can-bus-dev.cpp | 4 | ||||
-rw-r--r-- | src/can/can-message.cpp | 12 | ||||
-rw-r--r-- | src/can/can-message.hpp | 2 | ||||
-rw-r--r-- | src/can/can-signals.hpp | 9 |
4 files changed, 13 insertions, 14 deletions
diff --git a/src/can/can-bus-dev.cpp b/src/can/can-bus-dev.cpp index 32e852e..a6429ed 100644 --- a/src/can/can-bus-dev.cpp +++ b/src/can/can-bus-dev.cpp @@ -131,7 +131,7 @@ std::pair<struct canfd_frame&, size_t> can_bus_dev_t::read() DEBUG(binder_interface, "read: Found id: %X, length: %X, data %02X%02X%02X%02X%02X%02X%02X%02X", cfd.can_id, cfd.len, cfd.data[0], cfd.data[1], cfd.data[2], cfd.data[3], cfd.data[4], cfd.data[5], cfd.data[6], cfd.data[7]); - return can_message_t::convert_to_canfd_frame(cfd, nbytes); + return can_message_t::convert_from_canfd_frame(cfd, nbytes); } /// @brief start reading threads and set flag is_running_ @@ -167,7 +167,7 @@ void can_bus_dev_t::can_reader(can_bus_t& can_bus) } /// @brief Send a can message from a can_message_t object. -/// @param[in] can_msg the can message object to send +/// @param[in] can_msg the can message object to send int can_bus_dev_t::send_can_message(can_message_t& can_msg) { ssize_t nbytes; diff --git a/src/can/can-message.cpp b/src/can/can-message.cpp index 0053ef4..604d676 100644 --- a/src/can/can-message.cpp +++ b/src/can/can-message.cpp @@ -74,7 +74,7 @@ can_message_format_t can_message_t::get_format() const /** * @brief Retrieve flags_ member value. * -* @return flags_ class member +* @return flags_ class member */ uint8_t can_message_t::get_flags() const { @@ -84,7 +84,7 @@ uint8_t can_message_t::get_flags() const /** * @brief Retrieve data_ member value. * -* @return pointer to the first element +* @return pointer to the first element * of class member data_ */ const uint8_t* can_message_t::get_data() const @@ -123,7 +123,7 @@ bool can_message_t::is_correct_to_send() /** * @brief Set format_ member value. * -* Preferred way to initialize these members by using +* Preferred way to initialize these members by using * convert_from_canfd_frame method. * * @param[in] new_format - class member @@ -143,7 +143,7 @@ void can_message_t::set_format(const can_message_format_t new_format) * * @param[in] args - struct read from can bus device. */ -can_message_t can_message_t::convert_to_canfd_frame(const struct canfd_frame& frame, size_t nbytes) +can_message_t can_message_t::convert_from_canfd_frame(const struct canfd_frame& frame, size_t nbytes) { uint8_t maxdlen, length, flags = (uint8_t)NULL; uint32_t id; @@ -223,7 +223,7 @@ can_message_t can_message_t::convert_to_canfd_frame(const struct canfd_frame& fr data.push_back(frame.data[i]); }; - DEBUG(binder_interface, "convert_from_canfd_frame: Found id: %X, format: %X, length: %X, data %02X%02X%02X%02X%02X%02X%02X%02X", + DEBUG(binder_interface, "convert_from_canfd_frame: Found id: %X, format: %X, length: %X, data %02X%02X%02X%02X%02X%02X%02X%02X", id, format, length, data[0], data[1], data[2], data[3], data[4], data[5], data[6], data[7]); } @@ -231,7 +231,7 @@ can_message_t can_message_t::convert_to_canfd_frame(const struct canfd_frame& fr } /** -* @brief Take all initialized class's members and build an +* @brief Take all initialized class's members and build an * canfd_frame struct that can be use to send a CAN message over * the bus. * diff --git a/src/can/can-message.hpp b/src/can/can-message.hpp index 87d5fa5..19744d9 100644 --- a/src/can/can-message.hpp +++ b/src/can/can-message.hpp @@ -69,7 +69,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(); }; diff --git a/src/can/can-signals.hpp b/src/can/can-signals.hpp index e5e0f31..1100ab1 100644 --- a/src/can/can-signals.hpp +++ b/src/can/can-signals.hpp @@ -77,10 +77,10 @@ class can_signal_t private: can_message_definition_t message_; /*!< message_ - The message this signal is a part of. */ 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 + uint8_t bit_position_; /*!< 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. */ + uint8_t bit_size_; /*!< 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 @@ -95,7 +95,6 @@ private: * value if it has changed. */ std::map<int, std::string> states_; /*!< states_ - A map of CAN signal state describing the mapping * between numerical and string values for valid states. */ - uint8_t state_count_; /*!< state_count_ - The length of the states array. */ bool writable_; /*!< writable - True if the signal is allowed to be written from the USB host * back to CAN. Defaults to false.*/ SignalDecoder decoder_; /*!< decoder_ - An optional function to decode a signal from the bus to a human @@ -104,7 +103,7 @@ private: * CAN into a byte array. If NULL, the default numerical encoder * is used. */ bool received_; /*!< received_ - True if this signal has ever been received.*/ - float lastValue_; /*!< lastValue_ - The last received value of the signal. If 'received' is false, + float last_value_; /*!< lastValue_ - The last received value of the signal. If 'received' is false, * this value is undefined. */ public: @@ -112,4 +111,4 @@ public: std::string& get_generic_name() const; }; -void find_can_signals(const openxc_DynamicField &key, std::vector<can_signal_t*>& found_signals); +void find_can_signals(const openxc_DynamicField &key, std::vector<can_signal_t*>& found_signals);
\ No newline at end of file |