dg101 transition

This commit is contained in:
zhangsheng 2025-03-15 12:00:13 +08:00
parent e59d824ce8
commit f4a6f79f73
3 changed files with 1485 additions and 49 deletions

View File

@ -511,7 +511,22 @@ void Uart::DealRecvData(const char *pData) {
uint8_t command = pData[5] & 0xFF;
uint8_t recvcode = pData[7] & 0xFF;
char whereCon[100] = {0};
sprintf(whereCon, "zigbeeShortAddr='%02x%02x'", UINT16_HIGH(ushortAdd),UINT16_LOW(ushortAdd));
zlog_info(zct, "whereCon = %s", whereCon);
array_t vecRes = sqlite_db_ctrl::instance().GetDataMultiLine(T_SENSOR_INFO(TNAME), " dataNodeNo, MeasurementID,hardVersion,softVersion", whereCon);
zlog_info(zct, "vecRes = %d", vecRes.size());
std::string hardVersion = vecRes[0][2];
std::string softVersion = vecRes[0][3];
zlog_info(zct, "shortAdd = %02x%02x,command = %d ",UINT16_HIGH(ushortAdd),UINT16_LOW(ushortAdd),command);
if ((hardVersion == "3.0" && compareVersions(softVersion, "5.0") == -1) || (hardVersion == "4.0" && compareVersions(softVersion, "5.0") == -1)|| (hardVersion == "1.0" && compareVersions(softVersion,"1.2") == -1)) {
switch (command) {
case DEVICE_INF:
DealDataNodeFeature(pData,0);
break;
default: break;
}
}else{
switch (command) {
case DEVICE_INF:
DealDataNodeInfo(pData);
@ -564,6 +579,7 @@ void Uart::DealRecvData(const char *pData) {
default: break;
}
}
}
void Uart::DealDataNodeName(const char *pData) {
zlog_info(zct, "DealDataNodeName ");

View File

@ -177,6 +177,7 @@ public:
// feature parse
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 DealDataNodeWave(const char* pData, int comand);
void DealWaveThread();

File diff suppressed because it is too large Load Diff