From d4ce219e8031b201b71df5e7b71181f7a15e3240 Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Thu, 21 Nov 2019 17:59:07 +0100 Subject: 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 --- low-can-binding/can/message-definition.cpp | 4 +--- 1 file changed, 1 insertion(+), 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 -- cgit 1.2.3-korg