Skip to main content

encode_registers_response

Function encode_registers_response 

Source
pub fn encode_registers_response(
    function_code: u8,
    values: &[u16],
) -> Result<Vec<u8>, EncodeError>
Expand description

PDU for a FC 3/4 read response: byte count then big-endian registers.

Refuses past MAX_READ_RESPONSE_DATA. At 128 registers the old (values.len() * 2) as u8 declared a byte count of 0 and then wrote 256 octets of data behind it.