workable simple pixel-network output format

This commit is contained in:
Yunhorn 2024-08-05 18:36:46 +08:00
parent e990164543
commit 72930c94e8
2 changed files with 7 additions and 14 deletions

View File

@ -97,7 +97,7 @@ extern volatile uint8_t detected_hs_zone;
extern volatile STS_OO_RSS_SensorTuneDataTypeDef sts_presence_rss_config;
volatile uint32_t cnt=0;
extern volatile distance_measure_cfg_t distance_cfg;
volatile uint8_t sts_work_mode = STS_DUAL_MODE;
volatile uint8_t sts_work_mode = STS_RSS_MODE;
extern uint8_t luminance_level;
extern volatile uint8_t sts_status_color;
extern volatile uint8_t sts_lamp_bar_color; //puColor

View File

@ -94,7 +94,7 @@ volatile sts_cfg_nvm_t sts_cfg_nvm = {
'M', //Uplink data interval for heart-beat uplink
0x03,
'S', //Sampling sensor interval for real-time sensing of MEMS
0x04, // dual mode=4, uni_mode =5
0x03, // dual mode=4, uni_mode =5, RSS mode =3
0x00, // sts service mask
0x00, //sts_ioc_mask
0x20, //32 bytes, below start of p[0] 20 BYTES AND 12 BYTES FALL DOWN CFG
@ -2424,8 +2424,7 @@ void USER_APP_AUTO_RESPONDER_Parse(char *tlv_buf, size_t tlv_buf_size)
if ((tlv_buf[CFG_CMD4+j] >='0') && (tlv_buf[CFG_CMD4+j]<='9'))
{
sts_cfg_nvm.p[j] = (uint8_t)((tlv_buf[CFG_CMD4+j] - 0x30)&0xff);
APP_LOG(TS_OFF,VLEVEL_H,"\r\n tlv_buf %d = %02x cfg->p[%d]=%02x \r\n",
j,tlv_buf[CFG_CMD4+j], j, sts_cfg_nvm.p[j]);
// APP_LOG(TS_OFF,VLEVEL_H,"\r\n tlv_buf %d = %02x cfg->p[%d]=%02x \r\n", j,tlv_buf[CFG_CMD4+j], j, sts_cfg_nvm.p[j]);
} else {
invalid_flag = 1;
}
@ -2436,17 +2435,11 @@ void USER_APP_AUTO_RESPONDER_Parse(char *tlv_buf, size_t tlv_buf_size)
STS_PRESENCE_SENSOR_NVM_CFG_SIMPLE();
i=0; // Step 1: Prepare status update message
outbuf[i++] = (char) 'P';
outbuf[i++] = sts_mtmcode1;
outbuf[i++] = sts_mtmcode2;
outbuf[i++] = sts_version;
outbuf[i++] = sts_hardware_ver;
for (j=0; j < CFG_CMD_RSS_SIMPLE_SIZE; j++)
{
outbuf[i++] = (uint8_t)(sts_cfg_nvm.p[j]+0x30)&0xff;
}
APP_LOG(TS_OFF, VLEVEL_L, "###### RSS Simple CFG=%s\r\n",(uint8_t*)outbuf);
UTIL_MEM_set_8(outbuf, 0x0, sizeof(outbuf));
UTIL_MEM_cpy_8(outbuf, tlv_buf,tlv_buf_size);
i = tlv_buf_size;
APP_LOG(TS_OFF, VLEVEL_L, "###### RSS Simple CFG=%s\r\n",(char*)outbuf);
// Step 2: Save valid config to NVM
sts_cfg_nvm.mtmcode1 = sts_mtmcode1;