Encode raw payload bytes into an LSPS0 frame. Format: [0-1] Message type: 37913 (0x9419) as big-endian u16 [2..] Payload bytes
(payload: &[u8])
| 43 | /// [0-1] Message type: 37913 (0x9419) as big-endian u16 |
| 44 | /// [2..] Payload bytes |
| 45 | pub fn encode_frame(payload: &[u8]) -> Vec<u8> { |
| 46 | let mut bytes = Vec::with_capacity(2 + payload.len()); |
| 47 | bytes.extend_from_slice(&LSPS0_MESSAGE_TYPE.to_be_bytes()); |
| 48 | bytes.extend_from_slice(payload); |
| 49 | bytes |
| 50 | } |
| 51 | |
| 52 | /// Decode an LSPS0 frame and return the raw payload bytes. |
| 53 | /// |
no outgoing calls