From: Arthur GUYADER Date: Thu, 12 Dec 2019 12:56:13 +0000 (+0100) Subject: msg_def: returns pgn if j1939 used X-Git-Tag: 8.99.5~26 X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F82%2F23382%2F3;p=apps%2Fagl-service-can-low-level.git msg_def: returns pgn if j1939 used This commit patch function get_id. It was only capable to return id and id extended. Now it returns also pgn. Change-Id: If5feb7e2ee3bc5ca33b16620d1b998c95414dda8 Signed-off-by: Arthur Guyader Signed-off-by: Romain Forlot --- diff --git a/low-can-binding/can/message-definition.cpp b/low-can-binding/can/message-definition.cpp index 6989a909..8184e983 100644 --- a/low-can-binding/can/message-definition.cpp +++ b/low-can-binding/can/message-definition.cpp @@ -68,7 +68,8 @@ const std::string message_definition_t::get_name() const{ uint32_t message_definition_t::get_id() const { - return ((id_ & CAN_SFF_MASK) != id_) ? id_ | CAN_EFF_FLAG : id_; + return is_j1939() || ((id_ & CAN_SFF_MASK) == id_) ? + id_ : id_ | CAN_EFF_FLAG ; } bool message_definition_t::is_fd() const