aboutsummaryrefslogtreecommitdiffstats
path: root/low-can-binding/can/message/can-message.cpp
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2019-12-04 17:56:16 +0100
committerRomain Forlot <romain.forlot@iot.bzh>2020-01-09 15:55:03 +0100
commitfad26418db56cf029d0b32f1fcc1309c545dac96 (patch)
tree363c09f9b709b179b87360ffc1c9f6529f7ff177 /low-can-binding/can/message/can-message.cpp
parent92a9d02e999eb72ff08fa0fea375553dbb76a4e6 (diff)
all: format
Remove unecessary brackets and replace if possible if...else by ternary operator. Bug-AGL: SPEC-2991 Change-Id: Ibe46b83dea976e050b9cd9eb7ee7ab2c33b63905 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'low-can-binding/can/message/can-message.cpp')
-rw-r--r--low-can-binding/can/message/can-message.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/low-can-binding/can/message/can-message.cpp b/low-can-binding/can/message/can-message.cpp
index 5c3e0f0e..a8843b9f 100644
--- a/low-can-binding/can/message/can-message.cpp
+++ b/low-can-binding/can/message/can-message.cpp
@@ -131,9 +131,7 @@ std::shared_ptr<can_message_t> can_message_t::convert_from_frame(const struct ca
if(rtr_flag)
length = frame.len& 0xF;
else
- {
length = (frame.len > maxdlen) ? maxdlen : frame.len;
- }
}
}
else
@@ -178,7 +176,9 @@ struct canfd_frame can_message_t::convert_to_canfd_frame()
::memcpy(frame.data, get_data(), length_);
}
else
+ {
AFB_ERROR("can_message_t not correctly initialized to be sent");
+ }
return frame;
}
@@ -261,7 +261,9 @@ struct can_frame can_message_t::convert_to_can_frame()
::memcpy(frame.data, get_data(), length_);
}
else
+ {
AFB_ERROR("can_message_t not correctly initialized to be sent");
+ }
return frame;
}
@@ -276,9 +278,7 @@ std::string can_message_t::get_debug_message()
std::string ret = "";
ret = ret + "Here is the next can message : id " + std::to_string(id_) + " length " + std::to_string(length_) + ", data ";
for (size_t i = 0; i < data_.size(); i++)
- {
ret = ret + std::to_string(data_[i]);
- }
return ret;
}