From 723d7cceb495159c1eed0fa86b4a69b0fe9f0ecf Mon Sep 17 00:00:00 2001 From: zhangsheng Date: Thu, 21 Nov 2024 17:33:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=BC=82=E5=B8=B8=E6=B3=A2?= =?UTF-8?q?=E5=BD=A2=E5=AD=98=E5=82=A8=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- uart/uart.cpp | 3 --- uart/uart_feature_parse.cpp | 19 +++++++++++-------- uart/uart_parameter_config.cpp | 3 --- 3 files changed, 11 insertions(+), 14 deletions(-) diff --git a/uart/uart.cpp b/uart/uart.cpp index 65cd705..d844838 100644 --- a/uart/uart.cpp +++ b/uart/uart.cpp @@ -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); diff --git a/uart/uart_feature_parse.cpp b/uart/uart_feature_parse.cpp index 60b4016..4af4163 100644 --- a/uart/uart_feature_parse.cpp +++ b/uart/uart_feature_parse.cpp @@ -811,14 +811,17 @@ void Uart::DealWave() { g_VecWaveDataZ.clear(); VecWaveDataZ.clear(); } - char localtimestamp[32] = {0}; - GetTimeNet(localtimestamp, 1); - char insertSql[100] = {0x00}; - char whereCon[50] = {0x00}; - sprintf(whereCon, "MeasurementID='%s'",strMeasurementID.c_str()); - 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); + if (m_waveCountX > 0 || m_waveCountY > 0 || m_waveCountZ > 0) + { + char localtimestamp[32] = {0}; + GetTimeNet(localtimestamp, 1); + char insertSql[100] = {0x00}; + char whereCon[50] = {0x00}; + sprintf(whereCon, "MeasurementID='%s'",strMeasurementID.c_str()); + 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; } } diff --git a/uart/uart_parameter_config.cpp b/uart/uart_parameter_config.cpp index f0b7f9d..f868e3b 100644 --- a/uart/uart_parameter_config.cpp +++ b/uart/uart_parameter_config.cpp @@ -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 {