libmodbus
libmodbus copied to clipboard
Added function "modbus_read_device_information_object"
This PR adds a new function to access the built in device information from Modbus devices.
Changes:
- A new function code "MODBUS_FC_READ_DEVICE_INFORMATION" was added.
- Device information object codes were added, e.g. MODBUS_OBJID_VENDORNAME.
- Function "modbus_read_device_information_object(modbus_t ctx, unsigned char object_id, char dest);" was added.
- Several internal functions were extended to handle the new function code.
Notes: I successfully tested to code with a server that uses big endian word and byte order. Therefore, the mapping in modbus.c:1432 might be wrong for clients with little endian word order, depending on how strings are handled.
Signed-off-by: Oliver Schwaneberg [email protected]
You need to include documentation for your new functions too
I will also add the documentations and update the PR.
I have updated the PR. Please take a look.