Browse Source

Change the nb of registers sent by the server to avoid a duplicate

With the previous value UT_REGISTERS_NB, the server sent two
consecutives and identical responses to the client. These requests
could be confusing for the human reader!
Stéphane Raimbault 14 năm trước cách đây
mục cha
commit
ce5435c4ae
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      tests/unit-test-server.c

+ 1 - 1
tests/unit-test-server.c

@@ -127,7 +127,7 @@ int main(int argc, char*argv[])
                 == UT_REGISTERS_NB_SPECIAL) {
                 printf("Set an incorrect number of values\n");
                 MODBUS_SET_INT16_TO_INT8(query, header_length + 3,
-                                         UT_REGISTERS_NB);
+                                         UT_REGISTERS_NB_SPECIAL - 1);
             } else if (MODBUS_GET_INT16_FROM_INT8(query, header_length + 1)
                 == UT_REGISTERS_ADDRESS_SPECIAL) {
                 printf("Reply to this special register address by an exception\n");