Skip to main content

encode_v1

Function encode_v1 

Source
pub fn encode_v1(cmd: u16, payload: &[u8]) -> Option<Vec<u8>>
Expand description

Encode an MSPv1 request $M<. cmd and payload.len() must each fit in a byte; a command or payload that does not is a v2-only frame, so this returns None rather than truncating (a silent truncation would corrupt the FC command — fail loudly instead).