Commit a0aa885d0175311ef9e77fdade59cb9b0f3f8cf2

Authored by Michael Haberler
Committed by Stéphane Raimbault
1 parent dd4adad8

serial_mode isn't a bitmask

Showing 1 changed file with 1 additions and 1 deletions
src/modbus-rtu.c
@@ -826,7 +826,7 @@ int modbus_rtu_set_serial_mode(modbus_t *ctx, int mode) @@ -826,7 +826,7 @@ int modbus_rtu_set_serial_mode(modbus_t *ctx, int mode)
826 return -1; 826 return -1;
827 } 827 }
828 828
829 - ctx_rtu->serial_mode |= MODBUS_RTU_RS485; 829 + ctx_rtu->serial_mode = MODBUS_RTU_RS485;
830 return 0; 830 return 0;
831 } else if (mode == MODBUS_RTU_RS232) { 831 } else if (mode == MODBUS_RTU_RS232) {
832 if (ioctl(ctx->s, TIOCSRS485, &rs485conf) < 0) { 832 if (ioctl(ctx->s, TIOCSRS485, &rs485conf) < 0) {