summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-03-09 02:25:46 +0100
committerRomain Forlot <romain.forlot@iot.bzh>2017-03-16 17:10:40 +0100
commitf1afeaf50836bf66153cb6cccbfbfdc1e2a5493b (patch)
tree9b006e190acd372e0f0c9e4bf9c82ce4e5e288a5 /src
parent40acdf8f4ee0ee4127ffb5f092aaf0376763e7ce (diff)
Typo and formating.
Change-Id: I864a2fe7f974b0f2bf5000f55c2dc71ecf32a314 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'src')
-rw-r--r--src/can/can-bus-dev.cpp4
-rw-r--r--src/can/can-message.cpp12
-rw-r--r--src/can/can-message.hpp2
-rw-r--r--src/can/can-signals.hpp9
-rw-r--r--src/diagnostic/diagnostic-message.hpp6
-rw-r--r--src/utils/socket.cpp12
-rw-r--r--src/utils/socket.hpp6
7 files changed, 25 insertions, 26 deletions
diff --git a/src/can/can-bus-dev.cpp b/src/can/can-bus-dev.cpp
index 32e852e3..a6429edd 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 0053ef46..604d6764 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 87d5fa51..19744d91 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 e5e0f311..1100ab10 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
diff --git a/src/diagnostic/diagnostic-message.hpp b/src/diagnostic/diagnostic-message.hpp
index ccfd6d0a..33035ff1 100644
--- a/src/diagnostic/diagnostic-message.hpp
+++ b/src/diagnostic/diagnostic-message.hpp
@@ -68,9 +68,9 @@ typedef struct _Obd2Pid {
class obd2_signal_t {
private:
uint8_t pid_; /*!< pid - The 1 byte PID.*/
- const std::string generic_name_; /*!< generic_name_ - A human readable name to use for this PID when published.*/
- const int min_; /*!< min_ - Minimum value that can take this pid */
- const int max_; /*!< max_ - Maximum value that can take this pid */
+ std::string generic_name_; /*!< generic_name_ - A human readable name to use for this PID when published.*/
+ int min_; /*!< min_ - Minimum value that can take this pid */
+ int max_; /*!< max_ - Maximum value that can take this pid */
enum UNIT unit_; /*!< unit_ : Which unit system is used by that pid. See enum UNIT above.*/
int frequency_; /*!< frequency - The frequency to request this PID if supported by the vehicle when automatic, recurring OBD-II requests are enabled.*/
bool supported_; /*!< supported_ - boolean indicating whether this pid is supported by the vehicle or not.*/
diff --git a/src/utils/socket.cpp b/src/utils/socket.cpp
index 8badddfc..e75e27f2 100644
--- a/src/utils/socket.cpp
+++ b/src/utils/socket.cpp
@@ -39,14 +39,14 @@ namespace utils
if(socket_ != INVALID_SOCKET)
::close(socket_);
}
-
+
/// @brief Test if socket is valid.
/// @return true if valid, false otherwise.
socket_t::operator bool() const
{
return socket_ != INVALID_SOCKET;
}
-
+
/// @brief Open the socket.
/// @param[in] domain Specifies the communications domain in which a socket is to be created.
/// @param[in] type Specifies the type of socket to be created.
@@ -58,28 +58,28 @@ namespace utils
socket_ = ::socket(domain, type, protocol);
return socket_;
}
-
+
/// @brief Close the socket.
/// @return 0 if success.
int socket_t::close()
{
return socket_ != INVALID_SOCKET ? ::close(socket_) : 0;
}
-
+
/// @brief Set socket option.
/// @return 0 if success.
int socket_t::setopt(int level, int optname, const void* optval, socklen_t optlen)
{
return socket_ != INVALID_SOCKET ? ::setsockopt(socket_, level, optname, optval, optlen) : 0;
}
-
+
/// @brief Bind the socket.
/// @return 0 if success.
int socket_t::bind(const struct sockaddr* addr, socklen_t len)
{
return socket_ != INVALID_SOCKET ? ::bind(socket_, addr, len) : 0;
}
-
+
/// @brief Get the file descriptor.
/// @return The socket's file descriptor
int socket_t::socket() const
diff --git a/src/utils/socket.hpp b/src/utils/socket.hpp
index e9ddf074..b42eee6a 100644
--- a/src/utils/socket.hpp
+++ b/src/utils/socket.hpp
@@ -30,15 +30,15 @@ namespace utils
socket_t(const socket_t&) = delete;
socket_t(socket_t&&);
~socket_t();
-
+
explicit operator bool() const;
-
+
int open(int domain, int type, int protocol);
int close();
int setopt(int level, int optname, const void* optval, socklen_t optlen);
int socket() const;
int bind(const struct sockaddr* addr, socklen_t len);
-
+
private:
int socket_;
};