sensor data ready OVERWRITE heart-beat message
This commit is contained in:
parent
a10ec2dde2
commit
0d537d423f
|
@ -905,25 +905,29 @@ 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_L, "\r\n\n\n**** heart_beat timer =%2u \r\n**** upload message_timer=%2u\r\n**** sensor_data_ready=%2u\r\n",
|
||||||
|
heart_beat_timer, upload_message_timer, sensor_data_ready);
|
||||||
|
|
||||||
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
|
||||||
|
|
||||||
if (heart_beat_timer != 0L)
|
if ((heart_beat_timer != 0L)&&(sensor_data_ready==0)) // sensor data OVERWRITE heart-beat message, 2024-05-12
|
||||||
{
|
{
|
||||||
heart_beat_timer = 0U;
|
heart_beat_timer = 0U;
|
||||||
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
|
||||||
|
|
||||||
} 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)
|
||||||
{
|
{
|
||||||
sensor_data_ready =0;
|
sensor_data_ready =0;
|
||||||
upload_message_timer =0;
|
upload_message_timer =0;
|
||||||
//AppData.Buffer[i++] = AppLedStateOn;
|
//AppData.Buffer[i++] = AppLedStateOn;
|
||||||
// i = PrepareSendTxData();
|
//i = PrepareSendTxData();
|
||||||
|
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
|
||||||
AppData.Buffer[i++] = (uint8_t)(sts_o7_sensorData.workmode)&0xff; //02 WORK MODE
|
AppData.Buffer[i++] = (uint8_t)(sts_o7_sensorData.workmode)&0xff; //02 WORK MODE
|
||||||
|
|
||||||
|
|
Binary file not shown.
Loading…
Reference in New Issue