Skip to main content

word

Function word 

Source
pub fn word(frame: &[u8; 3]) -> Result<u16, SensorError>
Expand description

Decodes one data word from its three-byte frame, checking the CRC.

§Arguments

  • frame - the word’s two bytes, most significant first, and its CRC.

§Returns

The 16-bit word.

§Errors

Returns SensorError::Crc if the CRC byte does not match the two data bytes.