Commit 1e288713828c9a3df504db323621852900ad2cc6
1 parent
0b22e719
Constant for broacast and test ordering
Showing
1 changed file
with
1 additions
and
1 deletions
src/modbus-rtu.c
| @@ -348,7 +348,7 @@ static int _modbus_rtu_pre_check_confirmation(modbus_t *ctx, const uint8_t *req, | @@ -348,7 +348,7 @@ static int _modbus_rtu_pre_check_confirmation(modbus_t *ctx, const uint8_t *req, | ||
| 348 | { | 348 | { |
| 349 | /* Check responding slave is the slave we requested (except for broacast | 349 | /* Check responding slave is the slave we requested (except for broacast |
| 350 | * request) */ | 350 | * request) */ |
| 351 | - if (req[0] != 0 && req[0] != rsp[0]) { | 351 | + if (req[0] != rsp[0] && req[0] != MODBUS_BROADCAST_ADDRESS) { |
| 352 | if (ctx->debug) { | 352 | if (ctx->debug) { |
| 353 | fprintf(stderr, | 353 | fprintf(stderr, |
| 354 | "The responding slave %d isn't the requested slave %d", | 354 | "The responding slave %d isn't the requested slave %d", |