libmodbus
libmodbus copied to clipboard
modbus_read_bits maps each bit on an entire uint8_t
Hello everyone,
I was studying the library, and found out that the modbus_read_bits function, maps each bit read on an entire byte. This is a bit cumbersome when reading 2000 coils, since it will require 2000 bytes to be preallocated instead of 250.
Is there any way to use this function and get the bits grouped? I think an alternative is to use modbus_send_raw_request and modbus_receive_confirmation, but from the documentation I read that they must be used for debugging purposes.
Any help would be appreciated. Thanks!
The proper way to do that would be to only use bit instead of byte for storage. Not currently on my TODO list.