diff options
author | 2019-11-21 17:59:07 +0100 | |
---|---|---|
committer | 2019-12-03 19:46:26 +0100 | |
commit | d4ce219e8031b201b71df5e7b71181f7a15e3240 (patch) | |
tree | a887195811f456ef71aa5d3ddaa5ab174e480aee | |
parent | 3111212de145f0bb8b939856ea659c3a86b348d9 (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.cpp | 4 |
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 |