Skip to content

Commit

Permalink
Merge pull request #473 from ZeroCM/parse_negative_git_id
Browse files Browse the repository at this point in the history
added mask to ensure can id is 29b
  • Loading branch information
jbendes authored Feb 13, 2024
2 parents 7105528 + 0a056d5 commit c4572da
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion zcm/transport/transport_can.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
#include <linux/can.h>
#include <linux/can/raw.h>

#define MASK_29B ((1 << 29) - 1)

// Define this the class name you want
#define ZCM_TRANS_CLASSNAME TransportCan
#define MTU (1<<14)
Expand Down Expand Up @@ -69,7 +71,7 @@ struct ZCM_TRANS_CLASSNAME : public zcm_trans_t
return;
} else {
char *endptr;
msgId = strtoul(msgIdStr->c_str(), &endptr, 10);
msgId = (strtoul(msgIdStr->c_str(), &endptr, 10) & MASK_29B);
if (*endptr != '\0') {
ZCM_DEBUG("Msg Id unspecified");
return;
Expand Down

0 comments on commit c4572da

Please sign in to comment.