liblightmodbus  2.0
A lightweight, cross-platform Modbus RTU library
Advanced configuration

Disabling master's incoming data buffer

Warning
This feature is considered experimental and requires EXPERIMENTAL module to be included

If the NO_MASTER_DATA_BUFFER module is included, no storage for incoming data will be allocated. Instead the ModbusMaster::data's coil and regs pointers point to where the regsiter/coil data starts in the ModbusMaster::response frame.

Note
The data in Modbus frames is in big-endian format. Please remember about that when you're processing it.
Warning
Disabling master's data buffer may be cause of unaligned memory access, which may cause problems on some platforms. Please be cautious when accessing data through ModbusMaster::data::regs pointer.

Invasive parsing

Note
This feature shall be used with NO_MASTER_DATA_BUFFER module included

If the MASTER_INVASIVE_PARSING module is included, the master's parsing functions will be allowed to alter the response frame contents. It enables the parsing function to convert the incoming data to currently used system's endianness, so it can be safely accessed directly afterwards.