From a45714b898f72620e85303d80862db2d55efafe9 Mon Sep 17 00:00:00 2001 From: Tester23 <85486843+openshwprojects@users.noreply.github.com> Date: Fri, 10 Jan 2025 00:21:09 +0100 Subject: [PATCH] selftest: check parsing names in send dp --- src/selftest/selftest_tuyaMCU.c | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/src/selftest/selftest_tuyaMCU.c b/src/selftest/selftest_tuyaMCU.c index 33aa04a83..48635cdaf 100644 --- a/src/selftest/selftest_tuyaMCU.c +++ b/src/selftest/selftest_tuyaMCU.c @@ -270,50 +270,49 @@ void Test_TuyaMCU_Basic() { // // check sending from OBK to MCU // - // OBK sends: - // 55 AA 00 06 00 05 1001000100 1C + // OBK sends: 55 AA 00 06 00 05 1001000100 1C //HEADER VER = 00 SetDP LEN dpId = 16 Bool V = 0 CHK CMD_ExecuteCommand("tuyaMcu_sendState 16 1 0", 0); SELFTEST_ASSERT_HAS_SENT_UART_STRING("55 AA 00 06 00 05 1001000100 1C"); // nothing is sent by OBK at that point SELFTEST_ASSERT_HAS_UART_EMPTY(); - // OBK sends: - // 55 AA 00 06 00 05 0101000101 0E + // OBK sends: 55 AA 00 06 00 05 0101000101 0E // HEADER VER = 00 Unk LEN dpId = 1 Bool V = 1 CHK CMD_ExecuteCommand("tuyaMcu_sendState 1 1 1", 0); SELFTEST_ASSERT_HAS_SENT_UART_STRING("55 AA 00 06 00 05 0101000101 0E"); // nothing is sent by OBK at that point SELFTEST_ASSERT_HAS_UART_EMPTY(); - // OBK sends: - // 55 AA 00 06 00 05 0101000100 0D + // OBK sends: 55 AA 00 06 00 05 0101000100 0D // HEADER VER = 00 Unk LEN dpId = 1 Bool V = 0 CHK CMD_ExecuteCommand("tuyaMcu_sendState 1 1 0", 0); SELFTEST_ASSERT_HAS_SENT_UART_STRING("55 AA 00 06 00 05 0101000100 0D"); // nothing is sent by OBK at that point SELFTEST_ASSERT_HAS_UART_EMPTY(); - - // OBK sends: - // 55 AA 00 06 00 05 6C01000101 79 + // OBK sends: 55 AA 00 06 00 05 6C01000101 79 // HEADER VER = 00 Unk LEN dpId = 108 Bool V = 1 CHK - CMD_ExecuteCommand("tuyaMcu_sendState 108 1 1", 0); + CMD_ExecuteCommand("tuyaMcu_sendState 108 bool 1", 0); SELFTEST_ASSERT_HAS_SENT_UART_STRING("55 AA 00 06 00 05 6C01000101 79"); // nothing is sent by OBK at that point SELFTEST_ASSERT_HAS_UART_EMPTY(); - - - // OBK sends: - // 55 AA 00 06 00 05 6D04000110 8C + // OBK sends: 55 AA 00 06 00 05 6D04000110 8C // HEADER VER = 00 Unk LEN dpId = 109 Enum V = 16 CHK CMD_ExecuteCommand("tuyaMcu_sendState 109 4 16", 0); SELFTEST_ASSERT_HAS_SENT_UART_STRING("55 AA 00 06 00 05 6D04000110 8C"); // nothing is sent by OBK at that point SELFTEST_ASSERT_HAS_UART_EMPTY(); - + // OBK sends: 55 AA 00 06 00 05 6D04000110 8C + // HEADER VER = 00 Unk LEN dpId = 109 Enum V = 16 CHK + CMD_ExecuteCommand("tuyaMcu_sendState 109 enum 16", 0); + SELFTEST_ASSERT_HAS_SENT_UART_STRING("55 AA 00 06 00 05 6D04000110 8C"); + // nothing is sent by OBK at that point + SELFTEST_ASSERT_HAS_UART_EMPTY(); + +