Commit 2b965d49f39a4aa541b7c5c43aeddb7bb8603721
1 parent
4c9b0298
- the test server is now an infinite loop
- use uint8_t* for the query
Showing
1 changed file
with
3 additions
and
5 deletions
tests/unit-test-slave.c
| ... | ... | @@ -72,13 +72,11 @@ int main(void) |
| 72 | 72 | |
| 73 | 73 | socket = modbus_init_listen_tcp(&mb_param); |
| 74 | 74 | |
| 75 | - i = 0; | |
| 76 | - while (i++ < 5) { | |
| 77 | - unsigned char query[MAX_PACKET_SIZE]; | |
| 75 | + while (1) { | |
| 76 | + uint8_t query[MAX_PACKET_SIZE]; | |
| 78 | 77 | int query_size; |
| 79 | - | |
| 78 | + | |
| 80 | 79 | ret = modbus_listen(&mb_param, query, &query_size); |
| 81 | - | |
| 82 | 80 | if (ret == 0) { |
| 83 | 81 | manage_query(&mb_param, query, query_size, &mb_mapping); |
| 84 | 82 | } else if (ret == CONNECTION_CLOSED) { | ... | ... |