summaryrefslogtreecommitdiffstats
path: root/low-can-binding/can/message-definition.cpp
diff options
context:
space:
mode:
authorArthur GUYADER <arthur.guyader@iot.bzh>2019-12-12 13:56:13 +0100
committerRomain Forlot <romain.forlot@iot.bzh>2020-01-09 16:25:36 +0100
commit707dff688bbd411974f472a3bdc3ad2faafbd3bd (patch)
treee9e76da3b31bb6271f0642bdf064f0e4299ae2b0 /low-can-binding/can/message-definition.cpp
parentcc48ab799cf5357f4d573d80c07f6843e50bc8e8 (diff)
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 <arthur.guyader@iot.bzh> Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'low-can-binding/can/message-definition.cpp')
-rw-r--r--low-can-binding/can/message-definition.cpp3
1 files changed, 2 insertions, 1 deletions
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