modbus_rtu_set_custom_rts.txt 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. modbus_rtu_set_custom_rts(3)
  2. ============================
  3. NAME
  4. ----
  5. modbus_rtu_set_custom_rts - set a function to be used for custom RTS implementation
  6. SYNOPSIS
  7. --------
  8. *int modbus_rtu_set_custom_rts(modbus_t *'ctx', void (*'set_rts') (modbus_t *ctx, int on))*
  9. DESCRIPTION
  10. -----------
  11. The _modbus_rtu_set_custom_rts()_ function shall set a custom function to be
  12. called when the RTS pin is to be set before and after a transmission. By default
  13. this is set to an internal function that toggles the RTS pin using an ioctl
  14. call.
  15. Note that this function adheres to the RTS mode, the values MODBUS_RTU_RTS_UP or
  16. MODBUS_RTU_RTS_DOWN must be used for the function to be called.
  17. This function can only be used with a context using a RTU backend.
  18. RETURN VALUE
  19. ------------
  20. The _modbus_rtu_set_custom_rts()_ function shall return 0 if successful.
  21. Otherwise it shall return -1 and set errno to one of the values defined below.
  22. ERRORS
  23. ------
  24. *EINVAL*::
  25. The libmodbus backend is not RTU.
  26. AUTHORS
  27. -------
  28. Jimmy Bergström <jimmy@ekontroll.com>
  29. The libmodbus documentation was written by Stéphane Raimbault
  30. <stephane.raimbault@gmail.com>