libmodbus icon indicating copy to clipboard operation
libmodbus copied to clipboard

Added function "modbus_read_device_information_object"

Open Schwaneberg opened this issue 6 years ago • 3 comments

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]

Schwaneberg avatar Jul 31 '18 12:07 Schwaneberg

You need to include documentation for your new functions too

karlp avatar Jul 31 '18 13:07 karlp

I will also add the documentations and update the PR.

Schwaneberg avatar Aug 05 '18 19:08 Schwaneberg

I have updated the PR. Please take a look.

Schwaneberg avatar Sep 03 '18 06:09 Schwaneberg