Commit 3803f89e6e8aac951a24fd2b3f0df455494ef63b
1 parent
76284c17
Extract serial_mode attribute from platform tests
Bonus side effect: the integer isn't present anymore when TIOCSRS485 isn't supported on non Win32 platforms.
Showing
2 changed files
with
5 additions
and
0 deletions
src/modbus-rtu-private.h
src/modbus-rtu.c
| ... | ... | @@ -698,10 +698,13 @@ static int _modbus_rtu_connect(modbus_t *ctx) |
| 698 | 698 | if (tcsetattr(ctx->s, TCSANOW, &tios) < 0) { |
| 699 | 699 | return -1; |
| 700 | 700 | } |
| 701 | +#endif | |
| 701 | 702 | |
| 703 | +#if HAVE_DECL_TIOCSRS485 | |
| 702 | 704 | /* The RS232 mode has been set by default */ |
| 703 | 705 | ctx_rtu->serial_mode = MODBUS_RTU_RS232; |
| 704 | 706 | #endif |
| 707 | + | |
| 705 | 708 | return 0; |
| 706 | 709 | } |
| 707 | 710 | ... | ... |