modbus_reply.txt 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. modbus_reply(3)
  2. ===============
  3. NAME
  4. ----
  5. modbus_reply - send a reponse to the received request
  6. SYNOPSIS
  7. --------
  8. *int modbus_reply(modbus_t *'ctx', const uint8_t *'req', int 'req_length', modbus_mapping_t *'mb_mapping');
  9. DESCRIPTION
  10. -----------
  11. The *modbus_reply()* function shall send a response to received request. The
  12. request _req_ given in argument is analyzed, a response is then built and sent
  13. by using the information of the modbus context _ctx_.
  14. If the request indicates to read or write a value the operation will done in the
  15. modbus mapping _mb_mapping_ according to the type of the manipulated data.
  16. If an error occurs, an exception response will be sent.
  17. This function is designed for Modbus server.
  18. RETURN VALUE
  19. ------------
  20. The function shall return the length of the response sent if
  21. successful. Otherwise it shall return -1 and set errno.
  22. ERRORS
  23. ------
  24. *EMBMDATA*::
  25. Sending has failed
  26. See also the errors returned by the syscall used to send the response (eg. send
  27. or write).
  28. SEE ALSO
  29. --------
  30. linkmb:modbus_reply_exception[3]
  31. linkmb:libmodbus[7]
  32. AUTHORS
  33. -------
  34. The libmodbus documentation was written by Stéphane Raimbault
  35. <stephane.raimbault@gmail.com>