diff --git a/LoRaWAN/App/lora_app.c b/LoRaWAN/App/lora_app.c index d3ec12d..10e4623 100644 --- a/LoRaWAN/App/lora_app.c +++ b/LoRaWAN/App/lora_app.c @@ -498,6 +498,9 @@ void LoRaWAN_Init(void) } /* USER CODE BEGIN LoRaWAN_Init_Last */ + + STS_REBOOT_CONFIG_Init(); + #ifdef STS_P2 UTIL_SEQ_RegTask((1 << CFG_SEQ_Task_YunhornSTSEventP5), UTIL_SEQ_RFU, STS_YunhornSTSEventP5_Process); @@ -988,7 +991,7 @@ static void OnMacProcessNotify(void) /* USER CODE END OnMacProcessNotify_2 */ } -static void OnTxPeriodicityChanged(uint32_t periodicity) +void OnTxPeriodicityChanged(uint32_t periodicity) { /* USER CODE BEGIN OnTxPeriodicityChanged_1 */ @@ -1218,9 +1221,27 @@ static void OnYunhornSTSHeartBeatTimerEvent(void *context) * @brief Yunhorn STS Heart Beat Periodicity Chagne function * @param duration of periodicty in ms (1/1000 sec) */ -static void OnYunhornSTSHeartBeatPeriodicityChanged(uint32_t periodicity) +void OnYunhornSTSHeartBeatPeriodicityChanged(uint32_t periodicity) { + /* USER CODE BEGIN OnTxPeriodicityChanged_1 */ + /* USER CODE END OnTxPeriodicityChanged_1 */ + + if (periodicity == 0) + { + /* Revert to application default periodicity */ + periodicity = 10*APP_TX_DUTYCYCLE; //10*10 000 ms + } + + /* Update timer periodicity */ + + UTIL_TIMER_Stop(&YunhornSTSHeartBeatTimer); + UTIL_TIMER_SetPeriod(&YunhornSTSHeartBeatTimer, periodicity); + UTIL_TIMER_Start(&YunhornSTSHeartBeatTimer); + + /* USER CODE BEGIN OnTxPeriodicityChanged_2 */ + APP_LOG(TS_OFF, VLEVEL_H,"**************** HeartBeatPeriodicity = %u (sec)\r\n", periodicity/1000 ); + /* USER CODE END OnTxPeriodicityChanged_2 */ } /* USER CODE BEGIN PrFD_YunhornSTSWakeUpScanTimerEvents */ diff --git a/STS/Core/Src/yunhorn_sts_process.c b/STS/Core/Src/yunhorn_sts_process.c index 895b73c..6c6fc66 100644 --- a/STS/Core/Src/yunhorn_sts_process.c +++ b/STS/Core/Src/yunhorn_sts_process.c @@ -875,10 +875,6 @@ void USER_APP_AUTO_RESPONDER_Parse(uint8_t *parse_buffer, uint8_t parse_buffer_s memset((void*)outbuf,0x0, sizeof(outbuf)); UTIL_MEM_cpy_8((void*)tlv_buf,(void*)parse_buffer, parse_buffer_size&0x7F); /* 127 BYTES MAX */ - APP_LOG(TS_OFF, VLEVEL_M, "\n Auto_Responder_Parse: \n\t"); - for (uint8_t x=0; x 0)? sampling_heartbeat_periodicity : 1; // in seconds unit sampling_heartbeat_periodicity = sampling_heartbeat_periodicity*1000; @@ -1695,28 +1728,6 @@ void OnYunhornSTSHeartBeatTimerEvent(void *context) * YL x x x * */ -void OnYunhornSTSHeartBeatPeriodicityChanged(uint32_t periodicity) -{ - /* USER CODE BEGIN OnTxPeriodicityChanged_1 */ - - /* USER CODE END OnTxPeriodicityChanged_1 */ - - if (periodicity == 0) - { - /* Revert to application default periodicity */ - periodicity = 10*APP_TX_DUTYCYCLE; //10*10 000 ms - } - - /* Update timer periodicity */ - - UTIL_TIMER_Stop(&YunhornSTSHeartBeatTimer); - UTIL_TIMER_SetPeriod(&YunhornSTSHeartBeatTimer, periodicity); - UTIL_TIMER_Start(&YunhornSTSHeartBeatTimer); - - /* USER CODE BEGIN OnTxPeriodicityChanged_2 */ - APP_LOG(TS_OFF, VLEVEL_H,"**************** HeartBeatPeriodicity = %u (sec)\r\n", periodicity/1000 ); - /* USER CODE END OnTxPeriodicityChanged_2 */ -} /** * @brief Yunhorn STS Sensor Sampling Periodicity/interval Change callback function