Skip to main content

word

Function word 

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

Decodes one CRC-protected 16-bit word as the part sends it.

§Arguments

  • bytes - the most-significant data byte, the least-significant data byte, and the CRC over the two.

§Returns

The 16-bit word.

§Errors

Returns SensorError::Crc if the CRC byte does not match the two data bytes, so the read was corrupted and must be repeated.