Skip to content

COmparing CAN ID with values #818

Closed Answered by burrbull
Admsher asked this question in Q&A
Discussion options

You must be logged in to vote
let equal = match id {
    Standard(s) => s.as_raw() == my_val,
    Extended(e) => e.as_raw() == my_val as u32, // note that extended Id is 32-bit
};

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@burrbull
Comment options

Answer selected by Admsher
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #816 on October 16, 2024 15:12.