Skip to main content

pamoja_modbus_crc16

Function pamoja_modbus_crc16 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn pamoja_modbus_crc16( bytes: *const u8, bytes_len: usize, ) -> u16
Expand description

Computes the CRC-16/MODBUS that every RTU frame ends with.

§Returns

The checksum over bytes, or the checksum of an empty input when bytes is null and bytes_len is 0.

§Safety

bytes must point to at least bytes_len readable bytes, or be null when bytes_len is 0.