Commit 349b6dedb933ad7d87bd0832cd410a22fd66d882
1 parent
d928314a
Fix bandwidth-server-one (closes #152)
Showing
1 changed file
with
2 additions
and
2 deletions
tests/bandwidth-server-one.c
| @@ -59,7 +59,6 @@ int main(int argc, char *argv[]) | @@ -59,7 +59,6 @@ int main(int argc, char *argv[]) | ||
| 59 | 59 | ||
| 60 | if (use_backend == TCP) { | 60 | if (use_backend == TCP) { |
| 61 | ctx = modbus_new_tcp("127.0.0.1", 1502); | 61 | ctx = modbus_new_tcp("127.0.0.1", 1502); |
| 62 | - modbus_set_debug(ctx, TRUE); | ||
| 63 | s = modbus_tcp_listen(ctx, 1); | 62 | s = modbus_tcp_listen(ctx, 1); |
| 64 | modbus_tcp_accept(ctx, &s); | 63 | modbus_tcp_accept(ctx, &s); |
| 65 | 64 | ||
| @@ -69,7 +68,8 @@ int main(int argc, char *argv[]) | @@ -69,7 +68,8 @@ int main(int argc, char *argv[]) | ||
| 69 | modbus_connect(ctx); | 68 | modbus_connect(ctx); |
| 70 | } | 69 | } |
| 71 | 70 | ||
| 72 | - mb_mapping = modbus_mapping_new(1000, 1000, 1000, 1000); | 71 | + mb_mapping = modbus_mapping_new(MODBUS_MAX_READ_BITS, 0, |
| 72 | + MODBUS_MAX_READ_REGISTERS, 0); | ||
| 73 | if (mb_mapping == NULL) { | 73 | if (mb_mapping == NULL) { |
| 74 | fprintf(stderr, "Failed to allocate the mapping: %s\n", | 74 | fprintf(stderr, "Failed to allocate the mapping: %s\n", |
| 75 | modbus_strerror(errno)); | 75 | modbus_strerror(errno)); |