Explorar el Código

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 hace 14 años
padre
commit
ce5435c4ae
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  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");