优化异常波形存储逻辑

This commit is contained in:
zhangsheng 2024-11-21 17:33:45 +08:00
parent ef4dd93863
commit 723d7cceb4
3 changed files with 11 additions and 14 deletions

View File

@ -361,9 +361,7 @@ int Uart::DealAskTask(uint16_t ushortAdd){
}
else if (taskID == kScheduleUpgrade) //3.升级
{
zlog_info(zct, " UpdateWirelessNode 2222" );
UpdateWirelessNode(ushortAdd);
zlog_info(zct, " UpdateWirelessNode end1111" );
}else if (taskID == kScheduleConfigSensor) //4.更新配置
{
scheduleTask.cmd = CONFIG;
@ -523,7 +521,6 @@ void Uart::DealRecvData(const char *pData) {
break;
case ASK_TASK:
DealAskTask(ushortAdd);
zlog_info(zct, " DealAskTask end11111" );
break;
case DEVICE_EXCEPTION:
DealException(pData);

View File

@ -811,6 +811,8 @@ void Uart::DealWave() {
g_VecWaveDataZ.clear();
VecWaveDataZ.clear();
}
if (m_waveCountX > 0 || m_waveCountY > 0 || m_waveCountZ > 0)
{
char localtimestamp[32] = {0};
GetTimeNet(localtimestamp, 1);
char insertSql[100] = {0x00};
@ -819,6 +821,7 @@ void Uart::DealWave() {
memset(whereCon, 0x00, sizeof(whereCon));
sprintf(insertSql, "'%s','%02x%02x','%s',0,'1','%s' ", strMeasurementID.c_str(),(wave_shortAddr >> 8) & 0xFF,wave_shortAddr & 0xFF,localtimestamp,"");
sqlite_db_ctrl::instance().InsertData(" receive_wave_status ", insertSql);
}
wave_trans_ = false;
}
}

View File

@ -168,11 +168,8 @@ void Uart::UpdateWirelessNode(uint16_t shortAdd) {
}
Data[99] = tmp;
sleep(1);
zlog_info(zct, "111111111");
WriteToUart((const char*)Data, 100);
zlog_info(zct, "22222222222");
int iRet = CheckZigbeeACK();
zlog_info(zct, "333333333333");
if (iRet == 0) {
zlog_info(zct, "Packge ACK send success,shortAddr = %02x%02x", UINT16_HIGH(shortAdd), UINT16_LOW(shortAdd));
} else {