diff --git a/Core/Src/yunhorn_sts_presence_rss.c b/Core/Src/yunhorn_sts_presence_rss.c index 955ad11..12fed74 100644 --- a/Core/Src/yunhorn_sts_presence_rss.c +++ b/Core/Src/yunhorn_sts_presence_rss.c @@ -616,7 +616,7 @@ void STS_YunhornCheckStandardDeviation(void) #endif if (standard_variance_presence_score <= DEFAULT_UNCONCIOUS_THRESHOLD) { - sts_fall_rising_detected_result = STS_PRESENCE_STAYSTILL; + sts_fall_rising_detected_result = STS_PRESENCE_UNCONCIOUS; } if ( sts_fall_rising_pattern_factor1 > (uint16_t)sts_fall_detection_acc_threshold) diff --git a/Core/Src/yunhorn_sts_process.c b/Core/Src/yunhorn_sts_process.c index 16a6b94..929803b 100644 --- a/Core/Src/yunhorn_sts_process.c +++ b/Core/Src/yunhorn_sts_process.c @@ -550,9 +550,12 @@ void STS_PRESENCE_SENSOR_Prepare_Send_Data(void) sts_o7_sensorData.unconcious_state=(sts_fall_rising_detected_result == STS_PRESENCE_UNCONCIOUS)? 1:0; sts_o7_sensorData.fall_state = sts_fall_rising_detected_result; + if (sts_fall_rising_detected_result != STS_PRESENCE_NONE) { +#ifdef STS_O7 APP_LOG(TS_OFF, VLEVEL_M, "\r\n......FALL RISING DETECTION RESULT: %25s............\r\n",sts_presence_fall_detection_message[sts_fall_rising_detected_result] ); +#endif sts_o7_sensorData.fall_speed = (uint8_t)sts_fall_rising_pattern_factor1; sts_o7_sensorData.fall_gravity = (uint8_t)sts_roc_acc_standard_variance; } diff --git a/LoRaWAN/App/lora_app.c b/LoRaWAN/App/lora_app.c index c1b72c5..a5c112d 100644 --- a/LoRaWAN/App/lora_app.c +++ b/LoRaWAN/App/lora_app.c @@ -857,13 +857,14 @@ static void SendTxData(void) #endif #if 1 APP_LOG(TS_OFF, VLEVEL_L, - "\r\n######| Color | Mode |\r\n######| %4s | %5s |\r\n",(char *)sts_lamp_color_code[(uint8_t)(AppData.Buffer[0])], (char*)sts_work_mode_code[AppData.Buffer[1]]); - APP_LOG(TS_OFF, VLEVEL_L, - "\r\n######| S1-DoorOpen | S2-Motion | S3-No_Emergency | S4 |Distance(mm) | MotionScore| Unconcious | Over_Stay| Fall Detected|" - "\r\n######| %1d | %1d | %1d | %1d | %04d | %04d | %1d | %1d | %1d |\r\n", - AppData.Buffer[2], AppData.Buffer[3],AppData.Buffer[4], AppData.Buffer[5], - (uint16_t)sts_o7_sensorData.rss_presence_distance,(uint16_t)sts_o7_sensorData.rss_presence_score, - sts_o7_sensorData.unconcious_state, sts_o7_sensorData.unconcious_duration, sts_o7_sensorData.fall_state ); + "\r\n######| Color | Mode |\r\n######| %6s | %5s |\r\n",(char *)sts_lamp_color_code[(uint8_t)(AppData.Buffer[0])], (char*)sts_work_mode_code[AppData.Buffer[1]]); + + APP_LOG(TS_OFF, VLEVEL_L,"\r\n######| S1-DoorOpen | S2-Motion | S3-No_Emergency | S4 | Distance(mm) | MotionScore|\r\n######| %6u | %6u | %6u | %6u | %6u | %6u |\r\n", + AppData.Buffer[2], AppData.Buffer[3],AppData.Buffer[4],AppData.Buffer[5],AppData.Buffer[6]<<8|AppData.Buffer[7],AppData.Buffer[8]<<8|AppData.Buffer[9]); + + APP_LOG(TS_OFF, VLEVEL_L,"\r\n######| Unconcious | Fall state | Over_Stay state| Over stay duration |\r\n######| %1d | %1d | %1d | %4d |", + sts_o7_sensorData.unconcious_state, sts_o7_sensorData.fall_state, sts_o7_sensorData.over_stay_duration, sts_o7_sensorData.unconcious_duration ); + #endif } diff --git a/STM32CubeIDE/Release/STS_O7.bin b/STM32CubeIDE/Release/STS_O7.bin index fc8cb36..6844ec6 100644 Binary files a/STM32CubeIDE/Release/STS_O7.bin and b/STM32CubeIDE/Release/STS_O7.bin differ