diff --git a/Core/Inc/yunhorn_sts_prd_conf.h b/Core/Inc/yunhorn_sts_prd_conf.h index f7885ec..5476052 100644 --- a/Core/Inc/yunhorn_sts_prd_conf.h +++ b/Core/Inc/yunhorn_sts_prd_conf.h @@ -263,7 +263,7 @@ #ifdef YUNHORN_STS_R4_ENABLED #define sts_mtmcode1 0U -#define sts_mtmcode2 7U +#define sts_mtmcode2 86U #define sts_hardware_ver 1U #define sts_version 1U #define sts_senddataport (YUNHORN_STS_R4_LORA_APP_DATA_PORT) diff --git a/Core/Src/yunhorn_sts_process.c b/Core/Src/yunhorn_sts_process.c index 8c2f22f..6203d01 100644 --- a/Core/Src/yunhorn_sts_process.c +++ b/Core/Src/yunhorn_sts_process.c @@ -345,7 +345,7 @@ void STS_YunhornSTSEventP5_Process(void) */ void STS_YunhornSTSEventP6_Process(void) { - APP_LOG(TS_OFF, VLEVEL_L, "\r\n P6 Testing Process\r\n"); + APP_LOG(TS_OFF, VLEVEL_H, "\r\n P6 Testing Process\r\n"); STS_SENSOR_Power_ON(0); #ifdef LED_ONBOARD LED_ON; diff --git a/LoRaWAN/App/lora_app.c b/LoRaWAN/App/lora_app.c index a33841e..3ff5c5d 100644 --- a/LoRaWAN/App/lora_app.c +++ b/LoRaWAN/App/lora_app.c @@ -835,23 +835,25 @@ static void SendTxData(void) AppData.Port = LORAWAN_USER_APP_PORT; - AppData.Buffer[i++] = AppLedStateOn; - AppData.Buffer[i++] = (uint8_t)(0xFF & sts_mtmcode1); //mtmcode1; //#02 - AppData.Buffer[i++] = (uint8_t)(0xFF & sts_mtmcode2); //mtmcode2; //#03 - AppData.Buffer[i++] = (uint8_t)(0xFF & sts_hardware_ver); //hardware_Ver; //#04 - AppData.Buffer[i++] = (uint8_t)(0xFF & (99*batteryLevel/254)); //#05 + if (heart_beat_timer != 0U) { heart_beat_timer = 0U; AppData.Port = LORAWAN_USER_HTBT_PORT; //LORAWAN_USER_APP_PORT+1; - AppData.Buffer[i++] = (uint8_t)(0x01); //length of the following value - AppData.Buffer[i++] = (uint8_t)(r4_data.on_off_event); + AppData.Buffer[i++]= AppLedStateOn|0x80; + AppData.Buffer[i++] = (uint8_t)(0xFF & (99*batteryLevel/254)); //#05 } else if ((upload_message_timer != 0U)||(sensor_data_ready!= 0U)) //sensor_data_ready for manual push button-1 trigger) { sensor_data_ready =0; upload_message_timer =0; + AppData.Buffer[i++] = AppLedStateOn; + AppData.Buffer[i++] = (uint8_t)(0xFF & sts_mtmcode1); //mtmcode1; //#02 + AppData.Buffer[i++] = (uint8_t)(0xFF & sts_mtmcode2); //mtmcode2; //#03 + AppData.Buffer[i++] = (uint8_t)(0xFF & sts_hardware_ver); //hardware_Ver; //#04 + AppData.Buffer[i++] = (uint8_t)(0xFF & (99*batteryLevel/254)); //#05 + #if defined(STS_O5) AppData.Buffer[i++] = (uint8_t)(oo_data.state_sensor1_on_off)&0xff;