aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2019-11-21 17:59:07 +0100
committerRomain Forlot <romain.forlot@iot.bzh>2019-12-03 19:46:26 +0100
commitd4ce219e8031b201b71df5e7b71181f7a15e3240 (patch)
treea887195811f456ef71aa5d3ddaa5ab174e480aee
parent3111212de145f0bb8b939856ea659c3a86b348d9 (diff)
message: Correctly detect extended CAN id.
Previous test was always true. This fix the wrong test and then add the EFF flag correctly on messages using extended CAN id. Change-Id: I69686fd3d5a39ea3a0d1980b4bfa88fe36fb7fe5 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
-rw-r--r--low-can-binding/can/message-definition.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/low-can-binding/can/message-definition.cpp b/low-can-binding/can/message-definition.cpp
index 63541277..e6fd862f 100644
--- a/low-can-binding/can/message-definition.cpp
+++ b/low-can-binding/can/message-definition.cpp
@@ -72,9 +72,7 @@ const std::string message_definition_t::get_name() const{
uint32_t message_definition_t::get_id() const
{
- return id_ & CAN_EFF_MASK ?
- id_ | CAN_EFF_FLAG :
- id_;
+ return ((id_ & CAN_SFF_MASK) != id_) ? id_ | CAN_EFF_FLAG : id_;
}
bool message_definition_t::is_fd() const