summaryrefslogtreecommitdiffstats
path: root/low-can-binding/can
diff options
context:
space:
mode:
Diffstat (limited to 'low-can-binding/can')
-rw-r--r--low-can-binding/can/can-decoder.cpp4
-rw-r--r--low-can-binding/can/can-encoder.cpp12
-rw-r--r--low-can-binding/can/message/can-message.cpp14
-rw-r--r--low-can-binding/can/message/can-message.hpp12
-rw-r--r--low-can-binding/can/message/j1939-message.cpp6
-rw-r--r--low-can-binding/can/message/message.cpp4
-rw-r--r--low-can-binding/can/message/message.hpp2
-rwxr-xr-x[-rw-r--r--]low-can-binding/can/signals.cpp4
-rwxr-xr-x[-rw-r--r--]low-can-binding/can/signals.hpp6
9 files changed, 32 insertions, 32 deletions
diff --git a/low-can-binding/can/can-decoder.cpp b/low-can-binding/can/can-decoder.cpp
index 56626691..e901240b 100644
--- a/low-can-binding/can/can-decoder.cpp
+++ b/low-can-binding/can/can-decoder.cpp
@@ -50,13 +50,13 @@ float decoder_t::parse_signal_bitfield(signal_t& signal, std::shared_ptr<message
data_signal.push_back(data[i]);
// if(bit_size > 255)
-// AFB_ERROR("Error signal %s to long bit size",signal.get_name().c_str());
+// AFB_ERROR("Error signal %s to long bit size", signal.get_name().c_str());
// if(new_start_bit > 255)
// AFB_ERROR("Too long signal offset %d", new_start_bit);
if(data_signal.size() > 65535)
- AFB_ERROR("Too long data signal %s",signal.get_name().c_str());
+ AFB_ERROR("Too long data signal %s", signal.get_name().c_str());
return bitfield_parse_float(data_signal.data(), (uint16_t) data_signal.size(),
new_start_bit, bit_size, signal.get_factor(),
diff --git a/low-can-binding/can/can-encoder.cpp b/low-can-binding/can/can-encoder.cpp
index fb68b879..113428b9 100644
--- a/low-can-binding/can/can-encoder.cpp
+++ b/low-can-binding/can/can-encoder.cpp
@@ -47,7 +47,7 @@ void encoder_t::encode_data(std::shared_ptr<signal_t> sig, std::vector<uint8_t>
uint8_t len_signal_bytes = 0;
if(len_signal_bytes_tmp > 255)
{
- AFB_ERROR("Error signal %s too long",sig->get_name().c_str());
+ AFB_ERROR("Error signal %s too long", sig->get_name().c_str());
}
else
{
@@ -56,13 +56,13 @@ void encoder_t::encode_data(std::shared_ptr<signal_t> sig, std::vector<uint8_t>
/*
if(new_start_bit > 255)
{
- AFB_ERROR("Error signal %s too long",sig->get_name().c_str());
+ AFB_ERROR("Error signal %s too long", sig->get_name().c_str());
}
*/
uint8_t new_bit_size = 0;
if(bit_size > 255)
{
- AFB_ERROR("Error signal %s to long bit size",sig->get_name().c_str());
+ AFB_ERROR("Error signal %s to long bit size", sig->get_name().c_str());
}
else
{
@@ -148,7 +148,7 @@ message_t* encoder_t::build_frame(const std::shared_ptr<signal_t>& signal, uint6
for(const auto& sig: signal->get_message()->get_signals())
{
- encode_data(sig,data,false,factor,offset);
+ encode_data(sig, data, false, factor, offset);
}
message->set_data(data);
return message;
@@ -177,7 +177,7 @@ message_t* encoder_t::build_message(const std::shared_ptr<signal_t>& signal, uin
data,
0);
- return build_frame(signal,value,message, factor, offset);
+ return build_frame(signal, value, message, factor, offset);
}
#ifdef USE_FEATURE_J1939
else if(signal->get_message()->is_j1939())
@@ -188,7 +188,7 @@ message_t* encoder_t::build_message(const std::shared_ptr<signal_t>& signal, uin
J1939_NO_NAME,
signal->get_message()->get_id(),
J1939_NO_ADDR);
- return build_frame(signal,value,message, factor, offset);
+ return build_frame(signal, value, message, factor, offset);
}
#endif
else
diff --git a/low-can-binding/can/message/can-message.cpp b/low-can-binding/can/message/can-message.cpp
index 1f73c27e..5c3e0f0e 100644
--- a/low-can-binding/can/message/can-message.cpp
+++ b/low-can-binding/can/message/can-message.cpp
@@ -204,12 +204,12 @@ struct std::vector<canfd_frame> can_message_t::convert_to_canfd_frame_vector()
std::vector<uint8_t> data = get_data_vector((i*64),(i*64)+63);
if(data.size()<64)
{
- ::memset(frame.data,0,sizeof(frame.data));
- ::memcpy(frame.data,data.data(),data.size());
+ ::memset(frame.data, 0, sizeof(frame.data));
+ ::memcpy(frame.data, data.data(), data.size());
}
else
{
- ::memcpy(frame.data,data.data(),64);
+ ::memcpy(frame.data, data.data(), 64);
}
ret.push_back(frame);
i++;
@@ -226,13 +226,13 @@ struct std::vector<canfd_frame> can_message_t::convert_to_canfd_frame_vector()
std::vector<uint8_t> data = get_data_vector(i*8,(i*8)+7);
if(data.size()<8)
{
- ::memset(frame.data,0,sizeof(frame.data));
- ::memcpy(frame.data,data.data(),data.size());
+ ::memset(frame.data, 0, sizeof(frame.data));
+ ::memcpy(frame.data, data.data(), data.size());
}
else
{
- ::memset(frame.data,0,sizeof(frame.data));
- ::memcpy(frame.data,data.data(),8);
+ ::memset(frame.data, 0, sizeof(frame.data));
+ ::memcpy(frame.data, data.data(), 8);
}
ret.push_back(frame);
i++;
diff --git a/low-can-binding/can/message/can-message.hpp b/low-can-binding/can/message/can-message.hpp
index acc3bfc1..9d501a25 100644
--- a/low-can-binding/can/message/can-message.hpp
+++ b/low-can-binding/can/message/can-message.hpp
@@ -40,12 +40,12 @@ class can_message_t : public message_t {
public:
can_message_t();
can_message_t( uint32_t maxdlen,
- uint32_t id,
- uint32_t length,
- bool rtr_flag_,
- uint32_t flags,
- std::vector<uint8_t>& data,
- uint64_t timestamp);
+ uint32_t id,
+ uint32_t length,
+ bool rtr_flag_,
+ uint32_t flags,
+ std::vector<uint8_t>& data,
+ uint64_t timestamp);
uint32_t get_id() const;
void set_id(const canid_t id);
diff --git a/low-can-binding/can/message/j1939-message.cpp b/low-can-binding/can/message/j1939-message.cpp
index 432a1393..3740ea20 100644
--- a/low-can-binding/can/message/j1939-message.cpp
+++ b/low-can-binding/can/message/j1939-message.cpp
@@ -94,7 +94,7 @@ uint8_t j1939_message_t::get_addr() const{
/// @param[in] timestamp - timestamp of the message
///
/// @return A j1939_message_t object fully initialized with sockaddr_can and data values.
-std::shared_ptr<j1939_message_t> j1939_message_t::convert_from_addr(struct sockaddr_can& addr, uint8_t (&data)[128],size_t nbytes, uint64_t timestamp)
+std::shared_ptr<j1939_message_t> j1939_message_t::convert_from_addr(struct sockaddr_can& addr, uint8_t (&data)[128], size_t nbytes, uint64_t timestamp)
{
int i;
uint32_t length = 0;
@@ -112,7 +112,7 @@ std::shared_ptr<j1939_message_t> j1939_message_t::convert_from_addr(struct socka
data_vector.clear();
std::string data_string;
- data_string = converter_t::to_hex(data,length);
+ data_string = converter_t::to_hex(data, length);
for(i=0;i<length;i++)
{
@@ -122,7 +122,7 @@ std::shared_ptr<j1939_message_t> j1939_message_t::convert_from_addr(struct socka
AFB_DEBUG("Found pgn: %X, length: %X, data %s",
addr.can_addr.j1939.pgn, length, data_string.c_str());
- return std::make_shared<j1939_message_t>(j1939_message_t(length, data_vector, timestamp,addr.can_addr.j1939.name,addr.can_addr.j1939.pgn,addr.can_addr.j1939.addr));
+ return std::make_shared<j1939_message_t>(j1939_message_t(length, data_vector, timestamp, addr.can_addr.j1939.name, addr.can_addr.j1939.pgn, addr.can_addr.j1939.addr));
}
/// @brief Test if members pgn_ and length are set.
diff --git a/low-can-binding/can/message/message.cpp b/low-can-binding/can/message/message.cpp
index 2496b672..2a23ca5a 100644
--- a/low-can-binding/can/message/message.cpp
+++ b/low-can-binding/can/message/message.cpp
@@ -83,7 +83,7 @@ const uint8_t* message_t::get_data() const
/// @return pointer to the first element
/// of class member data_
///
-const std::vector<uint8_t> message_t::get_data_vector(int start,int end) const
+const std::vector<uint8_t> message_t::get_data_vector(int start, int end) const
{
std::vector<uint8_t> ret;
if(start >= 0)
@@ -105,7 +105,7 @@ const std::vector<uint8_t> message_t::get_data_vector(int start,int end) const
}
else
{
- AFB_ERROR("Error index to get data vector, [%d-%d] - for length %d",start,end,length_);
+ AFB_ERROR("Error index to get data vector, [%d-%d] - for length %d", start, end, length_);
}
return ret;
}
diff --git a/low-can-binding/can/message/message.hpp b/low-can-binding/can/message/message.hpp
index 1a31a8d4..7f13ac47 100644
--- a/low-can-binding/can/message/message.hpp
+++ b/low-can-binding/can/message/message.hpp
@@ -66,7 +66,7 @@ public:
int get_sub_id() const;
const uint8_t* get_data() const;
const std::vector<uint8_t> get_data_vector() const;
- const std::vector<uint8_t> get_data_vector(int start,int end) const;
+ const std::vector<uint8_t> get_data_vector(int start, int end) const;
uint32_t get_length() const;
uint64_t get_timestamp() const;
diff --git a/low-can-binding/can/signals.cpp b/low-can-binding/can/signals.cpp
index 7d3b7331..57aefa55 100644..100755
--- a/low-can-binding/can/signals.cpp
+++ b/low-can-binding/can/signals.cpp
@@ -44,7 +44,7 @@ signal_t::signal_t(
signal_decoder decoder,
signal_encoder encoder,
bool received,
- std::pair<bool,int> multiplex,
+ std::pair<bool, int> multiplex,
bool is_big_endian,
bool is_signed,
std::string unit)
@@ -220,7 +220,7 @@ void signal_t::set_timestamp(uint64_t timestamp)
frequency_.tick(timestamp);
}
-std::pair<bool,int> signal_t::get_multiplex() const
+std::pair<bool, int> signal_t::get_multiplex() const
{
return multiplex_;
}
diff --git a/low-can-binding/can/signals.hpp b/low-can-binding/can/signals.hpp
index 2fcc27ed..32cd7606 100644..100755
--- a/low-can-binding/can/signals.hpp
+++ b/low-can-binding/can/signals.hpp
@@ -96,7 +96,7 @@ private:
bool received_; /*!< received_ - True if this signal has ever been received.*/
float last_value_; /*!< lastValue_ - The last received value of the signal. If 'received' is false,
* this value is undefined. */
- std::pair<bool,int> multiplex_; /*!< multiplex_ - If bool is false and int is 0 is not a multiplex signal
+ std::pair<bool, int> multiplex_; /*!< multiplex_ - If bool is false and int is 0 is not a multiplex signal
If bool is true, that indicate that is a multiplexor
If int is different of 0, that indicate the link with a multiplexor */
bool is_big_endian_; /*!< is_big_endian - True if the signal's data are meant to be read as a big_endian */
@@ -121,7 +121,7 @@ public:
signal_decoder decoder,
signal_encoder encoder,
bool received,
- std::pair<bool,int> multiplex,
+ std::pair<bool, int> multiplex,
bool is_big_endian,
bool is_signed,
std::string unit);
@@ -162,7 +162,7 @@ public:
bool get_received() const;
float get_last_value() const;
std::pair<float, uint64_t> get_last_value_with_timestamp() const;
- std::pair<bool,int> get_multiplex() const;
+ std::pair<bool, int> get_multiplex() const;
bool get_is_big_endian() const;
bool get_is_signed() const;
const std::string get_unit() const;