read_u16

Function read_u16 

Source
pub fn read_u16(data: &[u8]) -> Result<(u16, &[u8]), ModbusSerializationError>
Expand description

Reads an u16 from the given modbus data. The data is considered to be big endian with msB first

ยงErrors

If the data slice contains less than 2 bytes a ModbusSerializationError::UnexpectedEOF will be returned with its expected field set to 2 and its got field set to data.len().