| 1 | # modbus_rtu_get_rts |
| 2 | |
| 3 | ## Name |
| 4 | |
| 5 | modbus_rtu_get_rts - get the current RTS mode in RTU |
| 6 | |
| 7 | ## Synopsis |
| 8 | |
| 9 | ```c |
| 10 | int modbus_rtu_get_rts(modbus_t *ctx); |
| 11 | ``` |
| 12 | |
| 13 | ## Description |
| 14 | |
| 15 | The *modbus_rtu_get_rts()* function shall get the current Request To Send mode |
| 16 | of the libmodbus context `ctx`. The possible returned values are: |
| 17 | |
| 18 | - `MODBUS_RTU_RTS_NONE` |
| 19 | - `MODBUS_RTU_RTS_UP` |
| 20 | - `MODBUS_RTU_RTS_DOWN` |
| 21 | |
| 22 | This function can only be used with a context using a RTU backend. |
| 23 | |
| 24 | ## Return value |
| 25 | |
| 26 | The function shall return the current RTS mode if successful. Otherwise it |
| 27 | shall return -1 and set errno to one of the values defined below. |
| 28 | |
| 29 | ## Errors |
| 30 | |
| 31 | - *EINVAL*, the libmodbus backend is not RTU. |
| 32 | |
| 33 | ## See also |
| 34 | |
| 35 | - [modbus_rtu_set_rts](modbus_rtu_set_rts.md) |