modbus_get_response_timeout.txt 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. modbus_get_response_timeout(3)
  2. ==============================
  3. NAME
  4. ----
  5. modbus_get_response_timeout - get timeout for response
  6. SYNOPSIS
  7. --------
  8. *int modbus_get_response_timeout(modbus_t *'ctx', uint32_t *'to_sec', uint32_t *'to_usec');*
  9. DESCRIPTION
  10. -----------
  11. The *modbus_get_response_timeout()* function shall return the timeout interval
  12. used to wait for a response in the _to_sec_ and _to_usec_ arguments.
  13. RETURN VALUE
  14. ------------
  15. The function shall return 0 if successful. Otherwise it shall return -1 and set
  16. errno.
  17. EXAMPLE
  18. -------
  19. [source,c]
  20. -------------------
  21. uint32_t old_response_to_sec;
  22. uint32_t old_response_to_usec;
  23. /* Save original timeout */
  24. modbus_get_response_timeout(ctx, &old_response_to_sec, &old_response_to_usec);
  25. /* Define a new and too short timeout! */
  26. modbus_set_response_timeout(ctx, 0, 0);
  27. -------------------
  28. SEE ALSO
  29. --------
  30. linkmb:modbus_set_response_timeout[3]
  31. linkmb:modbus_get_byte_timeout[3]
  32. linkmb:modbus_set_byte_timeout[3]
  33. AUTHORS
  34. -------
  35. The libmodbus documentation was written by Stéphane Raimbault
  36. <stephane.raimbault@gmail.com>