(mut value: u16, out: &mut Vec<u8>)
| 322 | sample_rate: u32, |
| 323 | frames: u32, |
| 324 | payload: &[u8], |
| 325 | ) { |
| 326 | let mut packed = Vec::with_capacity(PMIC_COMPRESSED_HEADER_LEN + payload.len()); |
| 327 | packed.extend_from_slice(PMIC_MAGIC); |
| 328 | packed.extend_from_slice(&PMIC_VERSION_COMPRESSED.to_le_bytes()); |
| 329 | packed.extend_from_slice(&channels.to_le_bytes()); |
| 330 | packed.extend_from_slice(&sample_rate.to_le_bytes()); |
| 331 | packed.extend_from_slice(&frames.to_le_bytes()); |
| 332 | packed.push(codec); |
| 333 | packed.extend_from_slice(&[0, 0, 0]); |