Skip to content

Instantly share code, notes, and snippets.

@fbstj fbstj/CANframe.rs
Last active Aug 29, 2015

Embed
What would you like to do?
Rust things
enum ID {
Standard(u16),
Extended(u32)
}
enum Payload {
Value {
length : u8,
data: [u8; 8]
},
Remote(u8)
}
struct Frame {
id: ID,
payload: Payload
}
@fbstj

This comment has been minimized.

Copy link
Owner Author

commented May 18, 2015

it'd be great if there were a way of saying "value is between 0 and 8 bytes of data" and "Standard is 11 bits long, Extended is 29 bits long"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.