diff --git a/STM32CubeIDE/Release/WLE5CC_NODE_STS.bin b/STM32CubeIDE/Release/WLE5CC_NODE_STS.bin index 7c250b6..cb50f23 100644 Binary files a/STM32CubeIDE/Release/WLE5CC_NODE_STS.bin and b/STM32CubeIDE/Release/WLE5CC_NODE_STS.bin differ diff --git a/STM32CubeIDE/Release/WLE5CC_NODE_STS.elf b/STM32CubeIDE/Release/WLE5CC_NODE_STS.elf index 67062db..79a30c1 100644 Binary files a/STM32CubeIDE/Release/WLE5CC_NODE_STS.elf and b/STM32CubeIDE/Release/WLE5CC_NODE_STS.elf differ diff --git a/STS/Core/Src/yunhorn_sts_process.c b/STS/Core/Src/yunhorn_sts_process.c index 127da83..f72d2d3 100644 --- a/STS/Core/Src/yunhorn_sts_process.c +++ b/STS/Core/Src/yunhorn_sts_process.c @@ -564,7 +564,8 @@ void STS_YunhornSTSEventP5_Process(void) { APP_LOG(TS_OFF, VLEVEL_M, "\r\n Upload Fall Gesture Type 2 , status=%d \r\n", sts_fhmos_bitmap_pending); STS_FHMOS_sensor_upload_map(0x02); - + APP_LOG(TS_OFF, VLEVEL_M, "\r\n Upload Fall Gesture Type 4 , status=%d \r\n", sts_fhmos_bitmap_pending); + STS_FHMOS_sensor_upload_map(0x04); } #endif @@ -1986,7 +1987,7 @@ void STS_FHMOS_sensor_upload_map(uint8_t map_index) { #if 1 - //if (sts_fhmos_bitmap_pending == 0x01) + //if (sts_fhmos_bitmap_pending != FHMOS_BITMAP_BLANK) { APP_LOG(TS_OFF, VLEVEL_M, "\r\n +++++++++++++++++++++++ \r\nBitmap Pending to upload flag=%02x index=%d \r\n", sts_fhmos_bitmap_pending, map_index); diff --git a/hk_as923_decoder.js b/hk_as923_decoder.js index 50c4ced..b0d0f89 100644 --- a/hk_as923_decoder.js +++ b/hk_as923_decoder.js @@ -4,7 +4,7 @@ // - variables contains the device variables e.g. {"calibration": "3.5"} (both the key / value are of type string) // The function must return an object, e.g. {"temperature": 22.5} // -// Yunhorn SmarToilets Sensor R20250521R02 +// Yunhorn SmarToilets Sensor R20250522R01 // function Decode(fPort, data, variables) { @@ -283,6 +283,16 @@ function Decode(fPort, data, variables) { data.fhmos_gesture_map7 = bytes2matrix(13, bytes); data.fhmos_gesture_map8 = bytes2matrix(14, bytes); break; + case 0x04: // Gesture 3D map + data.fhmos_gesture_3Dmap1 = bytes2matrix3d(7, bytes); + data.fhmos_gesture_3Dmap2 = bytes2matrix3d(11, bytes); + data.fhmos_gesture_3Dmap3 = bytes2matrix3d(15, bytes); + data.fhmos_gesture_3Dmap4 = bytes2matrix3d(19, bytes); + data.fhmos_gesture_3Dmap5 = bytes2matrix3d(23, bytes); + data.fhmos_gesture_3Dmap6 = bytes2matrix3d(27, bytes); + data.fhmos_gesture_3Dmap7 = bytes2matrix3d(31, bytes); + data.fhmos_gesture_3Dmap8 = bytes2matrix3d(35, bytes); + break; } return { "Yunhorn_SmarToilets_data": data }; @@ -966,8 +976,7 @@ function Decode(fPort, data, variables) { break; case 8: - if ((bytes[0] == 'P') && (bytes[1] == '1') && (bytes[2] == '1')) - { + if ((bytes[0] == 'P') && (bytes[1] == '1') && (bytes[2] == '1')) { data.L8_CMD = l8code2cmd[bytes[3]]; if ((bytes[3] == '9')) { if (bytes[7] == 2) { @@ -992,7 +1001,7 @@ function Decode(fPort, data, variables) { if ((bytes[0] == 0x59) && (bytes[9] == 0x38)) { data.Yunhorn_PRD = "True"; data.PRD_String = String.fromCharCode(bytes[0], bytes[1], bytes[2], bytes[3], bytes[4], bytes[5], bytes[6]); - } + } break; // YUNHORN NVM CONFIG LENGTH @@ -1070,6 +1079,16 @@ function bytes2matrix(i, bytes) { return matrix0; } +function bytes2matrix3d(i, bytes) { + var mm1 = bytes[i]; + var mm2 = bytes[i + 1]; + var mm3 = bytes[i + 2]; + var mm4 = bytes[i + 3]; + var con = 0x30; + var matrix0 = " [ "; + matrix0 += (mm1 >> 4) + " " + (mm1 & 0x0f) + " " + (mm2 >> 4) + " " + (mm2 & 0x0f) + " " + (mm3 >> 4) + " " + (mm3 & 0x0f) + " " + (mm4 >> 4) + " " + (mm4 & 0x0f) + " ]"; + return matrix0; +} // // Yunhorn SmarToilets Sensor Decoder