diff --git a/test/test_SerialMuxProt/test_SerialMuxProt.cpp b/test/test_SerialMuxProt/test_SerialMuxProt.cpp index 9649f47..62b26ba 100644 --- a/test/test_SerialMuxProt/test_SerialMuxProt.cpp +++ b/test/test_SerialMuxProt/test_SerialMuxProt.cpp @@ -37,7 +37,7 @@ #include #include #include - +#include /****************************************************************************** * Compiler Switches *****************************************************************************/ @@ -180,14 +180,14 @@ static void testCmdSync() { SerialMuxProtServer<2U> testSerialMuxProtServer(gTestStream); uint8_t expectedOutputBufferVector[6U][MAX_FRAME_LEN] = { - {0x00, 0x0F, 0xFA, 0x00, 0x00, 0x00, 0x03, 0xE8}, /* SYNC 1000ms*/ - {0x00, 0x0F, 0xE6, 0x00, 0x00, 0x00, 0x07, 0xD0}, /* SYNC 2000ms*/ - {0x00, 0x0F, 0x82, 0x00, 0x00, 0x00, 0x1B, 0x58}, /* SYNC 7000ms*/ - {0x00, 0x0F, 0x1E, 0x00, 0x00, 0x00, 0x2E, 0xE0}, /* SYNC 12000ms*/ - {0x00, 0x0F, 0xB9, 0x00, 0x00, 0x00, 0x42, 0x68} /* SYNC 17000ms*/ + {0x00, 0x10, 0xFB, 0x00, 0xE8, 0x03, 0x00, 0x00}, /* SYNC 1000ms*/ + {0x00, 0x10, 0xE7, 0x00, 0xD0, 0x07, 0x00, 0x00}, /* SYNC 2000ms*/ + {0x00, 0x10, 0x83, 0x00, 0x58, 0x1B, 0x00, 0x00}, /* SYNC 7000ms*/ + {0x00, 0x10, 0x1F, 0x00, 0xE0, 0x2E, 0x00, 0x00}, /* SYNC 12000ms*/ + {0x00, 0x10, 0xBA, 0x00, 0x68, 0x42, 0x00, 0x00} /* SYNC 17000ms*/ }; - uint8_t inputQueueVector[2U][MAX_FRAME_LEN] = {{0x00, 0x0F, 0xE7, 0x01, 0x00, 0x00, 0x07, 0xD0}, - {0x00, 0x0F, 0x83, 0x01, 0x00, 0x00, 0x1B, 0x58}}; + uint8_t inputQueueVector[2U][MAX_FRAME_LEN] = {{0x00, 0x10, 0xE8, 0x01, 0xD0, 0x07, 0x00, 0x00}, + {0x00, 0x10, 0x84, 0x01, 0x58, 0x1B, 0x00, 0x00}}; /* * Case: Unsynced Heartbeat. @@ -293,12 +293,12 @@ static void testCmdSyncRsp() uint8_t testTime = 0U; uint8_t numberOfCases = 3U; uint8_t expectedOutputBufferVector[numberOfCases][MAX_FRAME_LEN] = { - {0x00, 0x0F, 0x10, 0x01, 0x00, 0x00, 0x00, 0x00}, - {0x00, 0x0F, 0x25, 0x01, 0x12, 0x34, 0x56, 0x78}, - {0x00, 0x0F, 0x10, 0x01, 0xFF, 0xFF, 0xFF, 0xFF}}; - uint8_t inputQueueVector[numberOfCases][MAX_FRAME_LEN] = {{0x00, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00}, - {0x00, 0x0F, 0x24, 0x00, 0x12, 0x34, 0x56, 0x78}, - {0x00, 0x0F, 0x0F, 0x00, 0xFF, 0xFF, 0xFF, 0xFF}}; + {0x00, 0x10, 0x11, 0x01, 0x00, 0x00, 0x00, 0x00}, + {0x00, 0x10, 0x26, 0x01, 0x78, 0x56, 0x34, 0x12}, + {0x00, 0x10, 0x11, 0x01, 0xFF, 0xFF, 0xFF, 0xFF}}; + uint8_t inputQueueVector[numberOfCases][MAX_FRAME_LEN] = {{0x00, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00}, + {0x00, 0x10, 0x25, 0x00, 0x78, 0x56, 0x34, 0x12}, + {0x00, 0x10, 0x10, 0x00, 0xFF, 0xFF, 0xFF, 0xFF}}; /* Ignore SYNC */ testSerialMuxProtServer.process(testTime++); @@ -326,9 +326,10 @@ static void testCmdScrb() uint8_t testTime = 0U; uint8_t numberOfCases = 2U; uint8_t expectedOutputBufferVector[numberOfCases][MAX_FRAME_LEN] = { - {0x00, 0x0F, 0x53, 0x03, 0x00, 'T', 'E', 'S', 'T'}, {0x00, 0x0F, 0x54, 0x03, 0x01, 'T', 'E', 'S', 'T'}}; + {0x00, 0x10, 0x54, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 'T', 'E', 'S', 'T'}, + {0x00, 0x10, 0x55, 0x03, 0x00, 0x00, 0x00, 0x00, 0x01, 'T', 'E', 'S', 'T'}}; uint8_t inputQueueVector[numberOfCases][MAX_FRAME_LEN] = { - {0x00, 0x0F, 0x52, 0x02, 'T', 'E', 'S', 'T', 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}; + {0x00, 0x10, 0x53, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 'T', 'E', 'S', 'T', 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}; /* Ignore SYNC */ testSerialMuxProtServer.process(testTime++); @@ -378,10 +379,11 @@ static void testCmdScrbRsp() uint8_t testTime = 1U; uint8_t numberOfCases = 3U; uint8_t expectedOutputBufferVector[numberOfCases][MAX_FRAME_LEN] = { - {0x00, 0x0F, 0x52, 0x02, 'T', 'E', 'S', 'T', 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}; - uint8_t inputQueueVector[numberOfCases][MAX_FRAME_LEN] = {{0x00, 0x0F, 0x10, 0x01, 0x00, 0x00, 0x00}, - {0x00, 0x0F, 0x53, 0x03, 0x00, 'T', 'E', 'S', 'T'}, - {0x00, 0x0F, 0x54, 0x03, 0x01, 'T', 'E', 'S', 'T'}}; + {0x00, 0x10, 0x53, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 'T', 'E', 'S', 'T', 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}; + uint8_t inputQueueVector[numberOfCases][MAX_FRAME_LEN] = { + {0x00, 0x10, 0x11, 0x01, 0x00, 0x00, 0x00, 0x00}, + {0x00, 0x10, 0x54, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 'T', 'E', 'S', 'T'}, + {0x00, 0x10, 0x55, 0x03, 0x00, 0x00, 0x00, 0x00, 0x01, 'T', 'E', 'S', 'T'}}; /* * Case: Suscribe to Unknown Channel @@ -506,7 +508,7 @@ static void testDataSend() { SerialMuxProtServer<1U> testSerialMuxProtServer(gTestStream); uint8_t expectedOutputBufferVector[1U][MAX_FRAME_LEN] = {{0x01, 0x04, 0x1A, 0x12, 0x34, 0x56, 0x78}}; - uint8_t inputQueueVector[1U][MAX_FRAME_LEN] = {{0x00, 0x0F, 0x10, 0x01, 0x00, 0x00, 0x00}}; + uint8_t inputQueueVector[1U][MAX_FRAME_LEN] = {{0x00, 0x10, 0x11, 0x01, 0x00, 0x00, 0x00, 0x00}}; /* Flush Stream */ gTestStream.flushInputBuffer();