Compare commits

..

No commits in common. "1b1b74168d99e4f31c073b732bd0e057d735a5f1" and "e59d824ce86ef730b640bfe5d87c6f18a1f9c5a6" have entirely different histories.

7 changed files with 250 additions and 1721 deletions

View File

@ -339,11 +339,10 @@ struct Param_61 {
}; };
struct Param_62 { struct Param_62 {
std::string MeasurementID; std::string MeasurementID;
std::string straxis;
std::string timeStart; std::string timeStart;
std::string timeEnd; std::string timeEnd;
int mPackageFlag; int mPackageFlag;
Param_62() : MeasurementID(""),straxis(""),timeStart(""),timeEnd(""),mPackageFlag(0){}; Param_62() : MeasurementID(""),timeStart(""),timeEnd(""),mPackageFlag(0){};
}; };
struct Param_63 { struct Param_63 {

View File

@ -900,11 +900,9 @@ std::string JsonData::JsonCmd_Cgi_62(Param_62 &param){
char szTableName[100] = {0x00}, whereCon[256] = {0x00}; char szTableName[100] = {0x00}, whereCon[256] = {0x00};
sprintf(szTableName, " receive_wave_status "); sprintf(szTableName, " receive_wave_status ");
if(param.straxis == "") sprintf(whereCon, " data_nodeno = '%s' and timeStamp < '%s' and timeStamp > '%s' ", param.MeasurementID.c_str(), param.timeEnd.c_str(), param.timeStart.c_str());
sprintf(whereCon, " data_nodeno like '%%%s%%' and timeStamp < '%s' and timeStamp > '%s' ", param.MeasurementID.c_str(), param.timeEnd.c_str(), param.timeStart.c_str());
else
sprintf(whereCon, " data_nodeno = '%s-%s' and timeStamp < '%s' and timeStamp > '%s' ", param.MeasurementID.c_str(),param.straxis.c_str(), param.timeEnd.c_str(), param.timeStart.c_str());
int rows = sqlite_db_ctrl::instance().GetTableRows(szTableName, whereCon); int rows = sqlite_db_ctrl::instance().GetTableRows(szTableName, whereCon);
int packgeNo = param.mPackageFlag; int packgeNo = param.mPackageFlag;
int packgeMax = 0; int packgeMax = 0;
@ -932,12 +930,7 @@ std::string JsonData::JsonCmd_Cgi_62(Param_62 &param){
} }
memset(whereCon, 0x00, sizeof(whereCon)); memset(whereCon, 0x00, sizeof(whereCon));
if(param.straxis == "") sprintf(whereCon, "data_nodeno = '%s' and timeStamp < '%s' and timeStamp > '%s' order by timeStamp asc LIMIT %d OFFSET %d", param.MeasurementID.c_str(), param.timeEnd.c_str(), param.timeStart.c_str(), 550, packgeNum);
{
sprintf(whereCon, "data_nodeno like '%%%s%%' and timeStamp < '%s' and timeStamp > '%s' order by timeStamp asc LIMIT %d OFFSET %d", param.MeasurementID.c_str(), param.timeEnd.c_str(), param.timeStart.c_str(), 550, packgeNum);
}else{
sprintf(whereCon, "data_nodeno = %s-%s' and timeStamp < '%s' and timeStamp > '%s' order by timeStamp asc LIMIT %d OFFSET %d", param.MeasurementID.c_str(),param.straxis.c_str(), param.timeEnd.c_str(), param.timeStart.c_str(), 550, packgeNum);
}
array_t vecRes; array_t vecRes;
vecRes = sqlite_db_ctrl::instance().GetDataMultiLine(szTableName, "*", whereCon); vecRes = sqlite_db_ctrl::instance().GetDataMultiLine(szTableName, "*", whereCon);

View File

@ -434,7 +434,6 @@ std::string LocalServer::HandleCgi_cmd(std::string &pData) {
param.mPackageFlag = recvBody["package"].asInt(); param.mPackageFlag = recvBody["package"].asInt();
param.timeStart = recvBody["timeStart"].asString(); param.timeStart = recvBody["timeStart"].asString();
param.timeEnd = recvBody["timeEnd"].asString(); param.timeEnd = recvBody["timeEnd"].asString();
param.straxis = recvBody["Raxis"].asString();
param.MeasurementID = recvBody["MeasurementID"].asString(); param.MeasurementID = recvBody["MeasurementID"].asString();
std::string data = jd.JsonCmd_Cgi_62(param); std::string data = jd.JsonCmd_Cgi_62(param);
return data; return data;

View File

@ -1,276 +1,243 @@
#include "thread_func.hpp" #include "thread_func.hpp"
#include <time.h> #include <time.h>
#include <math.h> #include <math.h>
#include <string.h> #include <string.h>
#include <cstdlib> #include <cstdlib>
#include <linux/types.h> #include <linux/types.h>
#include <sys/sysinfo.h> #include <sys/sysinfo.h>
#include <dirent.h> #include <dirent.h>
#include <map> #include <map>
#include <zlog.h> #include <zlog.h>
#include "mqttclient/mqtt_client.h" #include "mqttclient/mqtt_client.h"
#include "uart/uart.hpp" #include "uart/uart.hpp"
#include "common/common_func.hpp" #include "common/common_func.hpp"
#include "jsonparse/communication_cmd.hpp" #include "jsonparse/communication_cmd.hpp"
#include "wifi_5g/wpa_client.h" #include "wifi_5g/wpa_client.h"
extern zlog_category_t *zct; extern zlog_category_t *zct;
extern zlog_category_t *zbt; extern zlog_category_t *zbt;
void CheckThread() { void CheckThread() {
zlog_info(zbt, "ENTER CHECK THREAD "); zlog_info(zbt, "ENTER CHECK THREAD ");
int heart_count = 0; int heart_count = 0;
int time_check = 0; int time_check = 0;
int reset_flag = 0; int reset_flag = 0;
int online_check = 0; int online_check = 0;
int HardStatus = 0; int HardStatus = 0;
int logClean = 0; int logClean = 0;
int Battery = 0; int Battery = 0;
int commSignal = 0; int commSignal = 0;
int loose_check = 0; int loose_check = 0;
int mqttresend = 0; int mqttresend = 0;
int checkNet0 = 0;
int wifi_reconnect_count = 0; while (GlobalConfig::QuitFlag_G) {
while (GlobalConfig::QuitFlag_G) { GlobalConfig::threadStatus = 1;
GlobalConfig::threadStatus = 1; sleep(1);
sleep(1); if (10 == heart_count) {
if (10 == heart_count) { if (GlobalConfig::LinkCount > 30) {
if (GlobalConfig::LinkCount > 30) { zlog_error(zct, "MQTT connect failed ");
zlog_error(zct, "MQTT connect failed "); char connect[10] = {0x00};
} readStringValue("config", "connect", connect, (char *)GlobalConfig::Config_G.c_str());
std::string ipTemp = IpAddrInit(); if (atoi(connect)) {
GlobalConfig::IpAddr_G = ipTemp; zlog_error(zct, "MQTT connect failed,reboot");
heart_count = 0; exit(0);
} }
if (7200 == time_check) { // 2h }
time_check = 0; std::string ipTemp = IpAddrInit();
char buf[256] = {0}; GlobalConfig::IpAddr_G = ipTemp;
char buf2[256] = {0}; heart_count = 0;
sprintf(buf, "{\"dataNodeGatewayNo\":\"%s\",\"cmd\":\"12\",\"status\":\"REQ\"}", GlobalConfig::MacAddr_G.c_str()); }
sprintf(buf2, "{\"dataWatchNo\":\"%s\",\"cmd\":\"12\",\"status\":\"REQ\"}", GlobalConfig::MacAddr_G.c_str()); if (7200 == time_check) { // 2h
std::string str = std::string(buf); time_check = 0;
std::string str2 = std::string(buf2); char buf[256] = {0};
char buf2[256] = {0};
int iRet = data_publish(str.c_str(), GlobalConfig::Topic_G.mPubTiming.c_str()); sprintf(buf, "{\"dataNodeGatewayNo\":\"%s\",\"cmd\":\"12\",\"status\":\"REQ\"}", GlobalConfig::MacAddr_G.c_str());
iRet = data_publish(str.c_str(), GlobalConfig::Topic_G.mPubCmd.c_str()); sprintf(buf2, "{\"dataWatchNo\":\"%s\",\"cmd\":\"12\",\"status\":\"REQ\"}", GlobalConfig::MacAddr_G.c_str());
iRet = data_publish(str2.c_str(), GlobalConfig::Topic_G.mPubTiming.c_str()); std::string str = std::string(buf);
iRet = data_publish(str2.c_str(), GlobalConfig::Topic_G.mPubCmd.c_str()); std::string str2 = std::string(buf2);
if (iRet != 0) {
zlog_error(zct, "MQTT connect failed ,time check"); int iRet = data_publish(str.c_str(), GlobalConfig::Topic_G.mPubTiming.c_str());
#ifdef Q4G_MODULE iRet = data_publish(str.c_str(), GlobalConfig::Topic_G.mPubCmd.c_str());
char localtimestamp[32] = { 0 }; iRet = data_publish(str2.c_str(), GlobalConfig::Topic_G.mPubTiming.c_str());
GetTimeNet(localtimestamp, 1); iRet = data_publish(str2.c_str(), GlobalConfig::Topic_G.mPubCmd.c_str());
char whereCon[100]={0}; if (iRet != 0) {
sprintf(whereCon,"DATE(timestamp, 'unixepoch') = DATE('now') ORDER BY timeStamp DESC limit 0,1"); zlog_error(zct, "MQTT connect failed ,time check");
std::string strCount = sqlite_db_ctrl::instance().GetData(" reboot_record ", "count", whereCon); char connect[10] = {0x00};
if (atoi(strCount.c_str()) < 3)//当天大于三次不再重启进程 readStringValue("config", "connect", connect, (char *)GlobalConfig::Config_G.c_str());
{ if (atoi(connect)) {
char insertSql[64] = {0}; zlog_error(zct, "MQTT connect failed,time check ,reboot");
sprintf(insertSql, "'%s',%d,'%s'",localtimestamp,atoi(strCount.c_str())+1,"4G connect failed "); exit(0);
sqlite_db_ctrl::instance().InsertData(" reboot_record ", insertSql); }
gpio_set(GlobalConfig::GPIO_G.commPower,0); #ifdef NR5G_MODULE
zlog_warn(zct,"commPower start\n"); dial.closePort();
sleep(2); gpio_set(GlobalConfig::GPIO_G.commRest, 0);
gpio_set(GlobalConfig::GPIO_G.commPower,1); zlog_warn(zct, "GPIO 8 start");
zlog_warn(zct,"commPower End\n"); sleep(2);
sleep(2); gpio_set(GlobalConfig::GPIO_G.commRest, 1);
system("reboot"); zlog_warn(zct, "GPIO 8 End");
}else{ sleep(20);
zlog_error(zct,"Q4G_MODULE error\n"); dial.openPort("/dev/ttyUSB2");
} dial.setState();
#endif #endif
#ifdef NR5G_MODULE #ifdef WIFI_MODULE
dial.closePort(); zlog_warn(zct, "WiFi reset!");
gpio_set(GlobalConfig::GPIO_G.commPower, 0); gpio_set(GlobalConfig::GPIO_G.wifiReset, 0);
zlog_warn(zct, "commPower start"); sleep(5);
sleep(2); gpio_set(GlobalConfig::GPIO_G.wifiReset, 1);
gpio_set(GlobalConfig::GPIO_G.commPower, 1); sleep(5);
zlog_warn(zct, "commPower End"); wifi::WPAClient wpa;
sleep(20); wpa.ReconnectWiFi();
connectCount++; system("/etc/init.d/wpa_restart");
if (connectCount > 10) { system("udhcpc -i wlan2 &");
zlog_error(zct, "5G reset error ,reboot!"); #endif
system("reboot"); }
} }
dial.openPort("/dev/ttyUSB2"); if (HardStatus == 3600) { // one hour 3600
dial.setState(); JsonData jd;
jd.JsonCmd_07();
#endif HardStatus = 0;
#ifdef WIFI_MODULE }
zlog_warn(zct, "WiFi reset!"); if (mqttresend == 7200) {
system("/etc/init.d/wpa_restart"); mqttresend = 0;
sleep(5); zlog_info(zct, "mqttresend check");
std::string strip = GetGwIp_("wlan0"); Json::Value jsHeart;
zlog_warn(zct,"strip = %s", strip.c_str()); Json::FastWriter fw;
jsHeart["dataNodeGatewayNo"] = GlobalConfig::MacAddr_G;
gpio_set(GlobalConfig::GPIO_G.wifiReset, 1); jsHeart["status"] = "online_V" + GlobalConfig::Version;
sleep(5); jsHeart["IP"] = GlobalConfig::IpAddr_G;
gpio_set(GlobalConfig::GPIO_G.wifiReset, 0); std::string strJson = fw.write(jsHeart);
sleep(30); int iRet = data_publish(strJson.c_str(), GlobalConfig::Topic_G.mPubHeart.c_str());
wifi::WPAClient wpa; if (iRet == 0) {
wpa.ReconnectWiFi(); sqlite_db_ctrl::instance().QueryofflineData();
system("/etc/init.d/wpa_restart"); }
sleep(5); }
system("udhcpc -b -i wlan0 &");
if (1800 == online_check) {
#endif online_check = 0;
} JsonData jd;
} int Count = sqlite_db_ctrl::instance().GetTableRows(T_SENSOR_INFO(TNAME), NULL);
if (HardStatus == 3600) { // one hour 3600 if (Count > 0) {
JsonData jd; jd.DataNodeStatusCheck();
jd.JsonCmd_07(); char localtimestamp[32] = {0};
HardStatus = 0; GetTimeNet(localtimestamp, 1);
} std::string nowTimetamp = std::string(localtimestamp);
if(checkNet0 == 5){ char selectCon[128] = {0};
checkNet0 = 0; sprintf(selectCon, " sendMsg <> '' ORDER BY timeStamp DESC LIMIT 0,1");
int iStatus = get_netlink_status("eth0"); sleep(1);
if(iStatus == 1 && GlobalConfig::net0Status == 0){ std::string strTime = sqlite_db_ctrl::instance().GetData(T_DATASTATIC_INFO(TNAME), "timeStamp", selectCon);
system("ifconfig eth0:1 192.168.188.188 netmask 255.255.255.0"); long lTime = atol(nowTimetamp.c_str()) - atol(strTime.c_str());
} zlog_info(zct, "online check = %ld", lTime);
GlobalConfig::net0Status = iStatus; }
}
if (mqttresend == 7200) { }
mqttresend = 0; if (7200 == Battery) {
zlog_info(zct, "mqttresend check"); Battery = 0;
Json::Value jsHeart; zlog_info(zct, "Battery");
Json::FastWriter fw; sqlite_db_ctrl::instance().CalculateBattery();
jsHeart["dataNodeGatewayNo"] = GlobalConfig::MacAddr_G; JsonData jd;
jsHeart["status"] = "online_V" + GlobalConfig::Version; jd.JsonCmd_07();
jsHeart["IP"] = GlobalConfig::IpAddr_G; jd.JsonCmd_29();
std::string strJson = fw.write(jsHeart); jd.JsonCmd_30();
int iRet = data_publish(strJson.c_str(), GlobalConfig::Topic_G.mPubHeart.c_str()); jd.JsonCmd_31();
if (iRet == 0) { }
sqlite_db_ctrl::instance().QueryofflineData();
} if (3500 == loose_check) {
} zlog_info(zct, "loosecheck\n");
loose_check = 0;
if (1800 == online_check) { sqlite_db_ctrl::instance().CalculateDip();
online_check = 0; }
int Count = sqlite_db_ctrl::instance().GetTableRows(T_SENSOR_INFO(TNAME), NULL);
if (Count > 0) { if (18000 == commSignal) { // 5h
JsonData jd; Json::Value jsBody, jsonVal;
jd.DataNodeStatusCheck(); Json::FastWriter showValue;
char localtimestamp[32] = {0}; if (GlobalConfig::NetStatus == "\"NOCONN\"" || GlobalConfig::NetStatus == "\"CONNECT\"") {
GetTimeNet(localtimestamp, 1); if (GlobalConfig::NetSignal == 0) {
std::string nowTimetamp = std::string(localtimestamp); jsBody["communicationSignal"] = "未知";
char selectCon[128] = {0}; } else if (GlobalConfig::NetSignal > -80) {
sprintf(selectCon, " sendMsg <> '' ORDER BY timeStamp DESC LIMIT 0,1"); jsBody["commSignal"] = "";
sleep(1); } else if (GlobalConfig::NetSignal > -90 && GlobalConfig::NetSignal < -80) {
std::string strTime = sqlite_db_ctrl::instance().GetData(T_DATASTATIC_INFO(TNAME), "timeStamp", selectCon); jsBody["commSignal"] = "";
long lTime = atol(nowTimetamp.c_str()) - atol(strTime.c_str()); } else if (GlobalConfig::NetSignal > -105 && GlobalConfig::NetSignal < -90) {
zlog_info(zct, "online check = %ld", lTime); jsBody["commSignal"] = "一般";
} } else if (GlobalConfig::NetSignal < -105) {
} jsBody["commSignal"] = "";
if (7200 == Battery) { } else if (GlobalConfig::NetSignal < -115) {
Battery = 0; jsBody["commSignal"] = "不稳定";
zlog_warn(zct, "Battery"); }
sqlite_db_ctrl::instance().CalculateBattery();
JsonData jd; } else if (GlobalConfig::NetStatus == "\"SEARCH\"") {
jd.JsonCmd_30(); jsBody["commSignal"] = "搜索网络";
jd.JsonCmd_07(); } else if (GlobalConfig::NetStatus == "\"LIMSRV\"") {
jd.JsonCmd_29(); jsBody["commSignal"] = "未插卡";
jd.JsonCmd_31(); } else {
} jsBody["commSignal"] = "未知";
}
if (3500 == loose_check) {
zlog_warn(zct, "loosecheck\n"); jsonVal["cmd"] = "53";
loose_check = 0; std::string dataBody = showValue.write(jsBody);
sqlite_db_ctrl::instance().CalculateDip(); jsonVal["cmdBody"] = dataBody;
} data_publish(showValue.write(jsonVal).c_str(), GlobalConfig::Topic_G.mPubConfig.c_str());
}
if (18000 == commSignal) { // 5h if (21600 == logClean) {
Json::Value jsBody, jsonVal; logClean = 0;
Json::FastWriter showValue; char localtimestamp[32] = {0};
if (GlobalConfig::NetStatus == "\"NOCONN\"" || GlobalConfig::NetStatus == "\"CONNECT\"") { GetTimeNet(localtimestamp, 1);
if (GlobalConfig::NetSignal == 0) { char whereCon[1024] = {0};
jsBody["communicationSignal"] = "未知"; sprintf(whereCon, " timestamp < '%ld' ", atol(localtimestamp) - 2592000); //删除1个月前的数据
} else if (GlobalConfig::NetSignal > -80) { sqlite_db_ctrl::instance().DeleteTableData(" t_battery_history ", whereCon);
jsBody["commSignal"] = ""; sqlite_db_ctrl::instance().DeleteTableData(" receive_wave_status ", whereCon);
} else if (GlobalConfig::NetSignal > -90 && GlobalConfig::NetSignal < -80) { }
jsBody["commSignal"] = ""; #ifdef WIFI_MODULE
} else if (GlobalConfig::NetSignal > -105 && GlobalConfig::NetSignal < -90) { if (wifi_reconnect_count == 600) { // 每 10分钟重连WiFi网络
jsBody["commSignal"] = "一般"; wifi_reconnect_count = 0;
} else if (GlobalConfig::NetSignal < -105) { wifi::WPAClient wpa;
jsBody["commSignal"] = ""; std::string netssid = wpa.GetNetSsid();
} else if (GlobalConfig::NetSignal < -115) { std::string currentssid = "";
jsBody["commSignal"] = "不稳定"; if (0 == netssid.compare("")) {
} netssid = wpa.GetNetSsid();
}
} else if (GlobalConfig::NetStatus == "\"SEARCH\"") {
jsBody["commSignal"] = "搜索网络"; if (netssid.length() > 0) {
} else if (GlobalConfig::NetStatus == "\"LIMSRV\"") { currentssid = wpa.GetCurrentSSID();
jsBody["commSignal"] = "未插卡"; if (currentssid.length() > 0) {
} else { char buf[64] = {0};
jsBody["commSignal"] = "未知"; std::string rssiSend = "";
} rssiSend = "/opt/Cidn/wpa_cli signal_poll|grep RSSI | cut -f 2 -d '='";
system_custom(rssiSend.c_str(), buf);
jsonVal["cmd"] = "53"; std::string Rssi = std::string(buf);
std::string dataBody = showValue.write(jsBody);
jsonVal["cmdBody"] = dataBody; memset(buf, 0, 64);
data_publish(showValue.write(jsonVal).c_str(), GlobalConfig::Topic_G.mPubConfig.c_str()); sprintf(buf, "wifi:true Rssi:%s", Rssi.c_str());
} zlog_info(zct, "%s\n", buf);
if (21600 == logClean) {
logClean = 0; } else {
char localtimestamp[32] = {0}; std::string runinfo = "wifi:false\n";
GetTimeNet(localtimestamp, 1); zlog_info(zct, "%s\n", runinfo.c_str());
char whereCon[1024] = {0}; }
sprintf(whereCon, " timestamp < '%ld' ", atol(localtimestamp) - 2592000 * 2); //删除2个月前的数据 }
sqlite_db_ctrl::instance().DeleteTableData(" t_battery_history ", whereCon); if (wpa.ReconnectWiFi()) {
zlog_info(zct, "wifi reconnect ok\n");
sqlite_db_ctrl::instance().DeleteTableData(" receive_wave_status ", whereCon); }
} }
#ifdef WIFI_MODULE #endif
if (wifi_reconnect_count == 600) { // 每 10分钟重连WiFi网络
wifi_reconnect_count = 0; if (reset_flag > 7200) {
wifi::WPAClient wpa; reset_flag = 0;
std::string netssid = wpa.GetNetSsid(); }
std::string currentssid = ""; Battery++;
if (0 == netssid.compare("")) { reset_flag++;
netssid = wpa.GetNetSsid(); time_check++;
} heart_count++;
online_check++;
if (netssid.length() > 0) { HardStatus++;
currentssid = wpa.GetCurrentSSID(); logClean++;
if (currentssid.length() > 0) { loose_check++;
char buf[64] = {0}; mqttresend++;
std::string rssiSend = ""; #ifdef WIFI_MODULE
rssiSend = "/usr/sbin/wpa_cli signal_poll|grep RSSI | cut -f 2 -d '='"; wifi_reconnect_count++;
system_custom(rssiSend.c_str(), buf); #endif
std::string Rssi = std::string(buf); }
}
memset(buf, 0, 64);
sprintf(buf, "wifi:true Rssi:%s", Rssi.c_str());
zlog_info(zct, "%s\n", buf);
} else {
std::string runinfo = "wifi:false\n";
zlog_info(zct, "%s\n", runinfo.c_str());
}
}
if (wpa.ReconnectWiFi()) {
zlog_info(zct, "wifi reconnect ok\n");
}
}
#endif
if (reset_flag > 7200) {
reset_flag = 0;
}
Battery++;
reset_flag++;
time_check++;
heart_count++;
online_check++;
HardStatus++;
logClean++;
loose_check++;
mqttresend++;
checkNet0 ++;
#ifdef WIFI_MODULE
wifi_reconnect_count++;
#endif
}
}

View File

@ -510,8 +510,8 @@ void Uart::DealRecvData(const char *pData) {
uint16_t ushortAdd = BUILD_UINT16(pData[3] & 0xFF, pData[4] & 0xFF); uint16_t ushortAdd = BUILD_UINT16(pData[3] & 0xFF, pData[4] & 0xFF);
uint8_t command = pData[5] & 0xFF; uint8_t command = pData[5] & 0xFF;
uint8_t recvcode = pData[7] & 0xFF; uint8_t recvcode = pData[7] & 0xFF;
zlog_info(zct, "shortAdd = %02x%02x,command = %d ",UINT16_HIGH(ushortAdd),UINT16_LOW(ushortAdd),command);
switch (command) { switch (command) {
case DEVICE_INF: case DEVICE_INF:
DealDataNodeInfo(pData); DealDataNodeInfo(pData);
@ -563,7 +563,6 @@ void Uart::DealRecvData(const char *pData) {
break; break;
default: break; default: break;
} }
} }
void Uart::DealDataNodeName(const char *pData) { void Uart::DealDataNodeName(const char *pData) {
@ -682,13 +681,6 @@ void Uart::DealDataNodeInfo(const char *pData) {
memset(buf, 0, 32); memset(buf, 0, 32);
sprintf(buf, "%.1f", 0.1 * chTemp); sprintf(buf, "%.1f", 0.1 * chTemp);
dataNodeInfo.HardVersion = std::string(buf); dataNodeInfo.HardVersion = std::string(buf);
zlog_info(zct, "dataNodeInfo.HardVersion = %s", dataNodeInfo.HardVersion.c_str());
if (dataNodeInfo.HardVersion != "3.0" && dataNodeInfo.HardVersion != "4.0" && dataNodeInfo.HardVersion != "1.0" && dataNodeInfo.HardVersion != "2.0") {
DealDataNodeFeatureTransition(pData,0);
zlog_info(zct, "DealDataNodeFeatureTransition");
return;
}
chTemp = pRecvData->Data[10]; //软件版本 1 byte chTemp = pRecvData->Data[10]; //软件版本 1 byte
memset(buf, 0, 32); memset(buf, 0, 32);

View File

@ -177,7 +177,6 @@ public:
// feature parse // feature parse
void DealDataNodeFeature(const char* pData, int flag); void DealDataNodeFeature(const char* pData, int flag);
void DealDataNodeFeatureTransition(const char* pData,int flag = 0);
void RecordBattery(std::string& strLongAddr, DataRecvStatic& dataStatic, std::string& nowTimetamp); void RecordBattery(std::string& strLongAddr, DataRecvStatic& dataStatic, std::string& nowTimetamp);
void DealDataNodeWave(const char* pData, int comand); void DealDataNodeWave(const char* pData, int comand);
void DealWaveThread(); void DealWaveThread();

File diff suppressed because it is too large Load Diff