Skip to content

Instantly share code, notes, and snippets.

@fbstj
Last active August 29, 2015 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fbstj/6f74e37f51b1204854a3 to your computer and use it in GitHub Desktop.
Save fbstj/6f74e37f51b1204854a3 to your computer and use it in GitHub Desktop.
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
Copy link
Author

fbstj 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