fix bug of report NVM without 'C' prefix

This commit is contained in:
Yunhorn 2024-10-30 15:54:13 +08:00
parent 56274d7cb8
commit fd1fc501a5
6 changed files with 40 additions and 16 deletions

View File

@ -35,9 +35,9 @@
#if defined(STS_P2)||defined(STS_T6)
#include "app_tof_peoplecount.h"
#endif
#ifdef L8
//#ifdef L8
#include "app_tof.h"
#endif
//#endif
/* USER CODE END Includes */
/* External variables ---------------------------------------------------------*/

View File

@ -50,7 +50,7 @@ extern volatile sts_cfg_nvm_t sts_cfg_nvm;
extern volatile uint32_t rfac_timer;
extern volatile uint32_t STS_TOFScanPeriod_msec, STS_TxPeriod_sec, STS_HeartBeatTimerPeriod_sec;
volatile uint8_t sts_data_buf[LORAWAN_APP_DATA_BUFFER_MAX_SIZE]={0x0};
volatile LmHandlerAppData_t sts_app_data={ 0, 0, sts_data_buf };
//volatile LmHandlerAppData_t sts_app_data={ 0, 0, sts_data_buf };
/* USER CODE END EV */
@ -771,7 +771,7 @@ static void SendTxData(void)
#ifdef CAYENNE_LPP
uint8_t channel = 0;
#else
/*
uint16_t pressure = 0;
int16_t temperature = 0;
uint16_t humidity = 0;
@ -779,7 +779,8 @@ static void SendTxData(void)
int32_t latitude = 0;
int32_t longitude = 0;
uint16_t altitudeGps = 0;
*/
uint32_t i = 0;
#endif /* CAYENNE_LPP */
EnvSensors_Read(&sensor_data);

View File

@ -61,7 +61,25 @@
#elif defined(L8)
#define YUNHORN_STS_L8_ENABLED 1U
#endif
/*
#define PRD_O0 0x0000
#define PRD_O1 0x0001
#define PRD_O2 0x0002
#define PRD_O3 0x0004
#define PRD_O4 0x0008
#define PRD_O5 0x0010
#define PRD_O6 0x0020
#define PRD_O7 0x0040
#define PRD_O8 0x0080
#define PRD_09 0x0100
#define PRD_10 0x0200
#define PRD_11 0x0400
#define PRD_12 0x0800
#define PRD_13 0x1000
#define PRD_14 0x2000
#define PRD_15 0x4000
#define PRD_16 0x8000
*/
/* ########################## Product Selection ##############################
* @brief This is the list of Yunhorn STS products to be used in ALL product config

View File

@ -1117,8 +1117,9 @@ void USER_APP_AUTO_RESPONDER_Parse(uint8_t *parse_buffer, uint8_t parse_buffer_s
outbuf[i++] = (uint8_t) (cfg_in_nvm[NVM_CFG_START+j]);
}
#endif
UTIL_MEM_cpy_8(outbuf, cfg_in_nvm,44);
i=44;
outbuf[0] = 0x43; // 'C' for config
UTIL_MEM_cpy_8(outbuf+1, cfg_in_nvm,44);
i=45;
STS_SENSOR_Upload_Message(YUNHORN_STS_USER_APP_CTRL_REPLY_PORT, i, (uint8_t *)outbuf);
break;
@ -1232,9 +1233,9 @@ void USER_APP_AUTO_RESPONDER_Parse(uint8_t *parse_buffer, uint8_t parse_buffer_s
APP_LOG(TS_OFF,VLEVEL_M, "\nSTS Tx Periodicty changed to %u sec\n\r", STS_TxPeriod_sec);
#ifdef STS_R4
OnYunhornSTSTxPeriodicityChanged(STS_TxPeriod_sec*1000);
#endif
#if defined(STS_O6)||defined(STS_O7)
#elif defined(STS_R1D)||defined(STS_R1)||defined(STS_R5)||defined(STS_P2)||defined(STS_O6T)||defined(STS_R2)||defined(STS_R3)||defined(STS_R6)
OnYunhornSTSTxPeriodicityChanged(STS_TxPeriod_sec*1000);
#elif defined(STS_O6)||defined(STS_O7)
OnYunhornSTSHeartBeatPeriodicityChanged(periodicity_length);
#endif
// 2024-07-31
@ -1262,6 +1263,7 @@ void USER_APP_AUTO_RESPONDER_Parse(uint8_t *parse_buffer, uint8_t parse_buffer_s
break; /* End of Upload Periodic interval */
/* 2222222222222222222222222222222222222222222222222222222222222222 */
case 'L':
case 'S': /* Begin Sampling/HeartBeat interval */
if ((((char)tlv_buf[CFG_CMD3] >= '0') && ((char)tlv_buf[CFG_CMD3] <='9')
&& ((char)tlv_buf[CFG_CMD4] >='0') && ((char)tlv_buf[CFG_CMD4] <='9')) &&
@ -1277,10 +1279,10 @@ void USER_APP_AUTO_RESPONDER_Parse(uint8_t *parse_buffer, uint8_t parse_buffer_s
STS_HeartBeatTimerPeriod_sec = heart_beat_or_sampling_periodicity_length;
#if defined(STS_P2)||defined(STS_R4)||defined(STS_T6)
#if defined(STS_P2)||defined(STS_R4)||defined(STS_T6)||defined(STS_R1D)
OnYunhornSTSHeartBeatPeriodicityChanged(STS_HeartBeatTimerPeriod_sec*1000);
#endif
// LEGACY CODE, TO BE XXX LATER =============
#ifdef YUNHORN_STS_E0_ENABLED
SamplingPeriodicity = heart_beat_or_sampling_periodicity_length*1000; //translate to 1000ms=1s
OnYunhornSTSSamplingPeriodicityChanged(SamplingPeriodicity);
@ -1293,6 +1295,7 @@ void USER_APP_AUTO_RESPONDER_Parse(uint8_t *parse_buffer, uint8_t parse_buffer_s
SamplingPeriodicity = heart_beat_or_sampling_periodicity_length*1000; //translate to 1000ms=1s
OnYunhornSTSSamplingPeriodicityChanged(SamplingPeriodicity);
#endif
// LEGACY CODE, TO BE XXX LATER =============
// 2024-07-31
UTIL_MEM_set_8((void*)outbuf, 0x0, sizeof(outbuf));
UTIL_MEM_cpy_8((void*)outbuf,(void*)tlv_buf, parse_buffer_size);
@ -1317,9 +1320,9 @@ void USER_APP_AUTO_RESPONDER_Parse(uint8_t *parse_buffer, uint8_t parse_buffer_s
}
break; /* End Sampling/HeartBeat interval */
/* 2222222222222222222222222222222222222222222222222222222222222222 */
case 'L': /* Begin Sampling/HeartBeat interval */
/* YUNHORN TODO XXX */
break; /* End Sampling/HeartBeat interval */
// case 'L': /* Begin Sampling/HeartBeat interval */
// /* YUNHORN TODO XXX */
// break; /* End Sampling/HeartBeat interval */
default:
/* illegal CFG_CMD2*/
break;

View File

@ -34,6 +34,8 @@ extern "C" {
#elif defined(L8)
#include "53l8a1_ranging_sensor.h"
#include "app_tof_pin_conf.h"
#elif defined(STS_R1D)||defined(STS_R1)||defined(STS_R5)||defined(STS_R2)
#include "X-WL55_WLE5_53L0X.h"
#endif
#include "stm32wlxx_nucleo.h"