disable debug message

This commit is contained in:
Yunhorn 2024-05-17 13:18:59 +08:00
parent 9331937dd0
commit a1d434f759
3 changed files with 15 additions and 28 deletions

View File

@ -471,13 +471,13 @@ int sts_presence_rss_fall_rise_detection(void)
APP_LOG(TS_OFF, VLEVEL_H,"Fall Rise Detection, Motion Count = %u \r\n", (int)motion_count); APP_LOG(TS_OFF, VLEVEL_H,"Fall Rise Detection, Motion Count = %u \r\n", (int)motion_count);
sts_rss_result = (average_result > 0)? 1: 0; sts_rss_result = (average_result > 0)? 1: 0;
#if 0
APP_LOG(TS_OFF, VLEVEL_H,"Average Motion Result = %u OUTPUT RSS RESULT=%u \r\n", (int)average_result, sts_rss_result); APP_LOG(TS_OFF, VLEVEL_H,"Average Motion Result = %u OUTPUT RSS RESULT=%u \r\n", (int)average_result, sts_rss_result);
for (k=0; k<10; k++) { for (k=0; k<10; k++) {
if (motion_in_zone[k]>0) if (motion_in_zone[k]>0)
APP_LOG(TS_OFF, VLEVEL_L,"\nMotion in Zone %u, Count=%u \r\n", k, motion_in_zone[k]); APP_LOG(TS_OFF, VLEVEL_H,"\nMotion in Zone %u, Count=%u \r\n", k, motion_in_zone[k]);
} }
#endif
average_distance = (1000.0f*average_distance)/average_result; // in meters average_distance = (1000.0f*average_distance)/average_result; // in meters
average_score = (1000.0f*average_score)/average_result; average_score = (1000.0f*average_score)/average_result;
sts_presence_rss_distance = average_distance; sts_presence_rss_distance = average_distance;
@ -594,10 +594,10 @@ void STS_YunhornCheckStandardDeviation(void)
#ifdef LOG_RSS #ifdef LOG_RSS
APP_LOG(TS_OFF, VLEVEL_L, "\r\n-------------Distance Average =%6u; Variance = %6u ; Standard =%6u \r\n", APP_LOG(TS_OFF, VLEVEL_L, "\r\n-------------Distance Average =%6u; Variance = %6u ; Standard =%6u \r\n",
(int)(average_presence_distance*1000.0f), (int)(variance_presence_distance*1000.0f), (int)(standard_variance_presence_distance*1000.0f)); (int)(average_presence_distance*1000.0f), (int)(variance_presence_distance*1000.0f), (int)(standard_variance_presence_distance*1000.0f));
#endif
APP_LOG(TS_OFF, VLEVEL_M, "-------------Motion Average =%6u; Variance = %6u ; Standard =%6u \r\n", APP_LOG(TS_OFF, VLEVEL_M, "-------------Motion Average =%6u; Variance = %6u ; Standard =%6u \r\n",
(int)(average_presence_score*1000.0f), (int)(variance_presence_score*1000.0f), (int)(standard_variance_presence_score*1000.0f)); (int)(average_presence_score*1000.0f), (int)(variance_presence_score*1000.0f), (int)(standard_variance_presence_score*1000.0f));
#ifdef LOG_RSS
APP_LOG(TS_OFF, VLEVEL_L, "-------------ROC Dist Average =%6u; Variance = %6u ; Standard =%6u \r\n", APP_LOG(TS_OFF, VLEVEL_L, "-------------ROC Dist Average =%6u; Variance = %6u ; Standard =%6u \r\n",
(int)(average_roc_distance), (int)(variance_roc_distance), (int)(standard_variance_roc_distance)); (int)(average_roc_distance), (int)(variance_roc_distance), (int)(standard_variance_roc_distance));

View File

@ -532,18 +532,15 @@ void STS_PRESENCE_SENSOR_Prepare_Send_Data(void)
sts_o7_sensorData.state_sensor2_on_off = sts_rss_result; sts_o7_sensorData.state_sensor2_on_off = sts_rss_result;
sts_o7_sensorData.state_sensor3_on_off = HALL2_STATE;//sts_hall2_read; //sts_emergency_button_pushed; //sts_hall2_read sts_o7_sensorData.state_sensor3_on_off = HALL2_STATE;//sts_hall2_read; //sts_emergency_button_pushed; //sts_hall2_read
sts_o7_sensorData.state_sensor4_on_off = sts_rss_2nd_result; sts_o7_sensorData.state_sensor4_on_off = sts_rss_2nd_result;
APP_LOG(TS_OFF, VLEVEL_M, "\r\nPrepare Upload Message............\r\n");
if (sts_rss_result == STS_RESULT_MOTION) if (sts_rss_result == STS_RESULT_MOTION)
{ {
APP_LOG(TS_OFF, VLEVEL_M, "\r\n......STS_RESULT MOTION............\r\n");
sts_o7_sensorData.rss_presence_distance = (uint16_t)(sts_presence_rss_distance)&0xFFFF; sts_o7_sensorData.rss_presence_distance = (uint16_t)(sts_presence_rss_distance)&0xFFFF;
sts_o7_sensorData.rss_presence_score = (uint16_t)(sts_presence_rss_score)&0xFFFF; sts_o7_sensorData.rss_presence_score = (uint16_t)(sts_presence_rss_score)&0xFFFF;
// uint8_t sts_unconcious_state; // uint8_t sts_unconcious_state;
// uint16_t sts_unconcious_threshold, sts_unconcious_threshold_duration; // uint16_t sts_unconcious_threshold, sts_unconcious_threshold_duration;
} else { } else {
APP_LOG(TS_OFF, VLEVEL_M, "\r\n......STS_NO MOTION............\r\n");
sts_o7_sensorData.rss_presence_distance = 0x0; sts_o7_sensorData.rss_presence_distance = 0x0;
sts_o7_sensorData.rss_presence_score = 0x0; sts_o7_sensorData.rss_presence_score = 0x0;
} }
@ -553,7 +550,7 @@ void STS_PRESENCE_SENSOR_Prepare_Send_Data(void)
if (sts_fall_rising_detected_result != STS_PRESENCE_NONE) if (sts_fall_rising_detected_result != STS_PRESENCE_NONE)
{ {
#ifdef STS_O7 #if (defined(STS_O7)&&!defined(STS_O6))
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] ); 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 #endif
sts_o7_sensorData.fall_speed = (uint8_t)sts_fall_rising_pattern_factor1; sts_o7_sensorData.fall_speed = (uint8_t)sts_fall_rising_pattern_factor1;
@ -570,7 +567,7 @@ void STS_PRESENCE_SENSOR_Prepare_Send_Data(void)
if (check_time_tmp > sts_occupancy_overtime_threshold*60) if (check_time_tmp > sts_occupancy_overtime_threshold*60)
{ {
APP_LOG(TS_OFF, VLEVEL_M, "\r\n......OVER STAY............\r\n");
sts_occupancy_overtime_state = 1U; sts_occupancy_overtime_state = 1U;
sts_o7_sensorData.overtime = sts_occupancy_overtime_state; sts_o7_sensorData.overtime = sts_occupancy_overtime_state;
sts_o7_sensorData.over_stay_duration = check_time_tmp; sts_o7_sensorData.over_stay_duration = check_time_tmp;

View File

@ -807,12 +807,10 @@ static void SendTxData(void)
UTIL_TIMER_Time_t nextTxIn = 0; UTIL_TIMER_Time_t nextTxIn = 0;
uint8_t i = 0; uint8_t i = 0;
APP_LOG(TS_OFF, VLEVEL_M, "\r\n\n\n SendTxData Enter \r\n\n");
//if (LmHandlerIsBusy() == false) //if (LmHandlerIsBusy() == false)
{ {
AppData.Port = LORAWAN_USER_APP_PORT; AppData.Port = LORAWAN_USER_APP_PORT;
//AppData.Buffer[i++] = AppLedStateOn; //#01 //AppData.Buffer[i++] = AppLedStateOn; //#01
STS_PRESENCE_SENSOR_Prepare_Send_Data(); STS_PRESENCE_SENSOR_Prepare_Send_Data();
if ((heart_beat_timer != 0L)) // sensor data OVERWRITE heart-beat message, 2024-05-12 if ((heart_beat_timer != 0L)) // sensor data OVERWRITE heart-beat message, 2024-05-12
@ -820,18 +818,12 @@ static void SendTxData(void)
heart_beat_timer=0; heart_beat_timer=0;
AppData.Port = sts_sendhtbtport; //LORAWAN_USER_APP_PORT+1; AppData.Port = sts_sendhtbtport; //LORAWAN_USER_APP_PORT+1;
AppData.Buffer[i++]= AppLedStateOn|0x80; AppData.Buffer[i++]= AppLedStateOn|0x80;
AppData.Buffer[i++] = (uint8_t)(99*batteryLevel/254)&0xff; //#05 AppData.Buffer[i++] = (uint8_t)(99*batteryLevel/254)&0xff; //#05
APP_LOG(TS_OFF, VLEVEL_M, "\r\n\n\n SendTxData Enter Heart-Beat \r\n\n");
} else if ((upload_message_timer != 0U)||(sensor_data_ready!= 0U)) //sensor_data_ready for manual push button-1 trigger) } else if ((upload_message_timer != 0U)||(sensor_data_ready!= 0U)) //sensor_data_ready for manual push button-1 trigger)
{ {
APP_LOG(TS_OFF, VLEVEL_M, "\r\n\n\n SendTxData Enter Sensor Data Ready \r\n\n");
sensor_data_ready =0; sensor_data_ready =0;
//AppData.Buffer[i++] = AppLedStateOn; //AppData.Buffer[i++] = AppLedStateOn;
//STS_PRESENCE_SENSOR_Prepare_Send_Data(); //STS_PRESENCE_SENSOR_Prepare_Send_Data();
AppData.Buffer[i++] = (uint8_t)(sts_o7_sensorData.lamp_bar_color)&0xff; //01 AppData.Buffer[i++] = (uint8_t)(sts_o7_sensorData.lamp_bar_color)&0xff; //01
@ -857,12 +849,12 @@ static void SendTxData(void)
#endif #endif
#if 1 #if 1
APP_LOG(TS_OFF, VLEVEL_L, APP_LOG(TS_OFF, VLEVEL_L,
"\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]]); "\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", 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 | %06u | %04u |\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]); 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 |", APP_LOG(TS_OFF, VLEVEL_L,"\r\n######| Unconcious | Fall state| Over_Stay state| Over Stay duration|\r\n######| %1d | %1d | %1d | %4d |\r\n",
sts_o7_sensorData.unconcious_state, sts_o7_sensorData.fall_state, sts_o7_sensorData.over_stay_duration, sts_o7_sensorData.unconcious_duration ); sts_o7_sensorData.unconcious_state, sts_o7_sensorData.fall_state, sts_o7_sensorData.over_stay_duration, sts_o7_sensorData.unconcious_duration );
#endif #endif
@ -870,9 +862,7 @@ static void SendTxData(void)
AppData.BufferSize = (sts_service_mask > STS_SERVICE_MASK_L1? 0:i); AppData.BufferSize = (sts_service_mask > STS_SERVICE_MASK_L1? 0:i);
//AppData.BufferSize = (sts_service_mask > STS_SERVICE_MASK_L1? 0:i);
APP_LOG(TS_OFF, VLEVEL_L, "\r\n\n\n** ** AppData.PORT =%3d ** ** AppData.BufferSize=%3d ** Count Size=%3d\r\n", AppData.Port, AppData.BufferSize, i);
//AppData.BufferSize = (sts_service_mask > STS_SERVICE_MASK_L1? 0:i);
if ((JoinLedTimer.IsRunning) && (LmHandlerJoinStatus() == LORAMAC_HANDLER_SET)) if ((JoinLedTimer.IsRunning) && (LmHandlerJoinStatus() == LORAMAC_HANDLER_SET))
{ {