增加传感器配置信息上传到后端,本地测试通过,需要与后端同步测试
This commit is contained in:
parent
4c916b2a34
commit
79c3f9dff2
@ -43,6 +43,8 @@
|
||||
#define SN "/opt/system/sn" //设备序列号
|
||||
#define SYSTEMSTART "/opt/system/start" //系统启动类型标志 0:正常启动 1:重启 2:
|
||||
#define BUILD_UINT16(x,y) (((x & 0x00FFu) << 8u) | (y & 0x00FFu))
|
||||
// 生成UINT32 数据
|
||||
#define BUILD_UINT32(u,v,x,y) (((u & 0x00FFu) << 24u) | (v & 0x00FFu) << 16u) | (((x & 0x00FFu) << 8u) | (y & 0x00FFu))
|
||||
#define GENERAL_BUF_SIZE 128*1024
|
||||
|
||||
using namespace std;
|
||||
@ -136,29 +138,42 @@ struct DataNodeInfo {
|
||||
int TemTopFlag;
|
||||
int TemBotFlag;
|
||||
int EquipSta;//设备状态
|
||||
std::string ZigbeeLongAddr;
|
||||
std::string HardVersion;
|
||||
std::string SoftVersion;
|
||||
std::string BpNo;
|
||||
std::string SerialNo;
|
||||
std::string FirstPowerTime;
|
||||
std::string WakeupTime;
|
||||
std::string StaticTime;
|
||||
std::string WaveTime;
|
||||
int BateryV;
|
||||
std::string ProductNo;
|
||||
int RSSI; // 接收信号强度
|
||||
int ConfigFlag;
|
||||
std::string StartBrands;
|
||||
std::string StopBrands;
|
||||
unsigned int FeatureInterVal;
|
||||
unsigned int WaveInterVal;
|
||||
int SamplingRate;//采样率
|
||||
int Range;//量程
|
||||
std::string EnvelopeBandPass;
|
||||
std::string FaultFrequency;
|
||||
unsigned int FeatureInterVal; //特征值发送时间间隔,单位分钟
|
||||
unsigned int WaveInterVal; //原始数据发送时间间隔,单位分钟
|
||||
std::string ZigbeePanId;
|
||||
int ZigbeeChannel;
|
||||
std::string ZigbeeShortAddr;
|
||||
std::string ZigbeeLongAddr;
|
||||
std::string ZigbeeDesAddr;
|
||||
std::string ConfigDate;
|
||||
int ZigbeePower;
|
||||
int ZigbeeRetry;
|
||||
int ZigbeeRetryGap;
|
||||
int Range;//量程
|
||||
int SamplingRate;//采样率
|
||||
int ACCSampleTime;//采样时间
|
||||
|
||||
std::string StartBrands; //频带能量参数 1,2,3,4,5,START
|
||||
std::string StopBrands; //频带能量参数 1,2,3,4,5,END
|
||||
|
||||
std::string EnvelopeBandPass; //冲击带通频率
|
||||
std::string FaultFrequency; //故障频率1,2,3,4
|
||||
|
||||
std::string ConfigDate;//配置时间
|
||||
int VIntegralFilterFrequency;//速度积分滤波频率
|
||||
|
||||
int RSSI; // 接收信号强度
|
||||
|
||||
};
|
||||
|
||||
struct DataRecvStatic {
|
||||
@ -573,6 +588,7 @@ extern void ZoneConfig(std::string zoneid);
|
||||
extern std::string GetSysStatus();
|
||||
|
||||
extern bool CheckIP(const char *ip);
|
||||
|
||||
bool IsValidMask(std::string mask);
|
||||
//read update config file
|
||||
extern std::vector <std::string> ReadStrByOpt(std::string filename,std::string strUpdataFileName);
|
||||
|
@ -192,20 +192,35 @@ std::string JsonData::JsonCmd_26(Param_26 ¶m)
|
||||
jsSensorData["bpNo"] = arrRes[j][10];
|
||||
jsSensorData["serialNo"] = arrRes[j][11];
|
||||
jsSensorData["firstPowerTime"] = arrRes[j][12];
|
||||
jsSensorData["configFlag"] = boost::lexical_cast<int>(arrRes[j][13]);
|
||||
jsSensorData["startBrands"] = arrRes[j][14];
|
||||
jsSensorData["stopBrands"] = arrRes[j][15];
|
||||
jsSensorData["featureInterVal"] = boost::lexical_cast<string>(arrRes[j][16]);
|
||||
jsSensorData["waveInterVal"] = boost::lexical_cast<int>(arrRes[j][17]);
|
||||
jsSensorData["samplingRate"] = boost::lexical_cast<int>(arrRes[j][18]);
|
||||
jsSensorData["envelopeBandPass"] = arrRes[j][21];
|
||||
jsSensorData["faultFrequency"] = arrRes[j][22];
|
||||
jsSensorData["zigbeePanId"] = arrRes[j][23];
|
||||
jsSensorData["zigbeeChannel"] = boost::lexical_cast<string>(arrRes[j][24]);
|
||||
jsSensorData["zigbeeAddr"] = arrRes[j][25];
|
||||
jsSensorData["zigbeeDesAddr"] = arrRes[j][27];
|
||||
jsSensorData["status"] = boost::lexical_cast<int>(arrRes[j][28]);
|
||||
jsSensorData["timeStamp"] = arrRes[j][29];
|
||||
jsSensorData["WakeupTime"] = arrRes[j][13];
|
||||
jsSensorData["StaticTime"] = arrRes[j][14];
|
||||
jsSensorData["WaveTime"] = arrRes[j][15];
|
||||
jsSensorData["BateryV"] = arrRes[j][16];
|
||||
jsSensorData["ProductNo"] = arrRes[j][17];
|
||||
jsSensorData["configFlag"] = boost::lexical_cast<int>(arrRes[j][18]);
|
||||
jsSensorData["startBrands"] = arrRes[j][19];
|
||||
jsSensorData["stopBrands"] = arrRes[j][20];
|
||||
jsSensorData["featureInterVal"] = boost::lexical_cast<string>(arrRes[j][21]);
|
||||
jsSensorData["waveInterVal"] = boost::lexical_cast<int>(arrRes[j][22]);
|
||||
jsSensorData["samplingRate"] = boost::lexical_cast<int>(arrRes[j][23]);
|
||||
printf("stopBrands11111 = %s\n",arrRes[j][20].c_str());
|
||||
// jsSensorData["scope"] = boost::lexical_cast<int>(arrRes[j][24]);
|
||||
jsSensorData["range"] = boost::lexical_cast<int>(arrRes[j][25]);
|
||||
jsSensorData["envelopeBandPass"] = arrRes[j][26];
|
||||
jsSensorData["faultFrequency"] = arrRes[j][27];
|
||||
jsSensorData["zigbeePanId"] = arrRes[j][28];
|
||||
jsSensorData["zigbeeChannel"] = boost::lexical_cast<string>(arrRes[j][29]);
|
||||
jsSensorData["zigbeeAddr"] = arrRes[j][30];
|
||||
jsSensorData["zigbeeLongAddr"] = arrRes[j][31];
|
||||
jsSensorData["zigbeeDesAddr"] = arrRes[j][32];
|
||||
jsSensorData["ZigbeePower"] = arrRes[j][33];
|
||||
jsSensorData["ZigbeeRetry"] = arrRes[j][34];
|
||||
jsSensorData["ZigbeeRetryGap"] = arrRes[j][35];
|
||||
jsSensorData["ACCSampleTime"] = arrRes[j][36];
|
||||
jsSensorData["status"] = boost::lexical_cast<int>(arrRes[j][37]);
|
||||
jsSensorData["timeStamp"] = arrRes[j][38];
|
||||
jsSensorData["viff"] = arrRes[j][39];
|
||||
jsSensorData["RSSI"] = arrRes[j][40];
|
||||
jsArray.append(jsSensorData);
|
||||
}
|
||||
} else {
|
||||
@ -697,7 +712,7 @@ std::string JsonData::JsonCmd_Cgi_23(Param_23 ¶m)
|
||||
|
||||
WriteStr2Config(SERVERCONFIG, "Server", "localServerIpAddress", param.mServerIp);
|
||||
WriteStr2Config(SERVERCONFIG, "Server", "localServerPort", param.mPort);
|
||||
WriteStr2Config(SERVERCONFIG, "Server", "communicationMode", param.mCommMode);
|
||||
WriteStr2Config(SERVERCONFIG, "Server", "CommMode", param.mCommMode);
|
||||
system("reboot");
|
||||
}else if(0 == param.mMode && !(CheckIP(param.mServerIp.c_str()))){
|
||||
jsonVal["success"] = false;
|
||||
@ -708,7 +723,7 @@ std::string JsonData::JsonCmd_Cgi_23(Param_23 ¶m)
|
||||
|
||||
jsSystemSetting["ServerIpAddress"] = ReadStrByOpt(SERVERCONFIG, "Server", "localServerIpAddress");
|
||||
jsSystemSetting["ServerPort"] = boost::lexical_cast<int>(ReadStrByOpt(SERVERCONFIG, "Server", "localServerPort"));
|
||||
jsSystemSetting["CommMode"] = boost::lexical_cast<int>(ReadStrByOpt(SERVERCONFIG, "Server", "communicationMode"));
|
||||
jsSystemSetting["CommMode"] = boost::lexical_cast<int>(ReadStrByOpt(SERVERCONFIG, "Server", "CommMode"));
|
||||
|
||||
jsBody["SystemSettings"] = jsSystemSetting;
|
||||
jsonVal["content"] = jsBody;
|
||||
|
@ -336,7 +336,7 @@ try{
|
||||
param.mDnsName = recvBody["dnsName"].asString();
|
||||
param.mGateway = recvBody["gateway"].asString();
|
||||
param.mHostName = recvBody["hostName"].asString();
|
||||
param.mIp = recvBody["dataWatchIpAddress"].asString();
|
||||
param.mIp = recvBody["dataNodeGatewayIpAddress"].asString();
|
||||
param.mSubnetMask = recvBody["subnetMask"].asString();
|
||||
param.mNetworkPortStatus = recvBody["networkPortStatus"].asString();
|
||||
param.mMode = 0;
|
||||
|
@ -316,6 +316,7 @@ int start_client(const char *boardname, const char *gwid, const char* gwip, cons
|
||||
else{
|
||||
rc = mosquitto_connect_bind(mosq, host, port, keepalive, bind_address);
|
||||
}
|
||||
printf("host = %s port = %d rc = %d\n",host,port,rc);
|
||||
if (rc){
|
||||
if (!ud.quiet){
|
||||
if (rc == MOSQ_ERR_ERRNO){
|
||||
|
@ -106,9 +106,10 @@ void SearchDev::HandleRecv_1(const boost::system::error_code &pEc,size_t pBytesR
|
||||
case 4:{
|
||||
std::string status = jsData["status"].asString();
|
||||
if(status.compare("REQ") == 0) {
|
||||
jsData["dataNodeGatewayNo"] = GlobalConfig::MacAddr_G.c_str();
|
||||
jsData["dataWatchNo"] = GlobalConfig::MacAddr_G.c_str();
|
||||
jsData["localServerIpAddress"] = GlobalConfig::ServerIP;
|
||||
jsData["status"] = "ACK";
|
||||
jsData["status"] = "ACK";
|
||||
jsData["DeviceType"] = "WirelessGateWay";
|
||||
std::string strData = fw.write(jsData);
|
||||
print_info("send info %s ip: %s\n", strData.c_str(), mRecvEP1.address().to_string().c_str());
|
||||
ip::udp::endpoint remoteEP(ip::address::from_string(mRecvEP1.address().to_string()),
|
||||
|
@ -30,6 +30,7 @@ void CheckThread()
|
||||
int time_check = 0;
|
||||
int reset_flag = 0;
|
||||
int online_check = 0;
|
||||
int HardStatus = 0;
|
||||
|
||||
while (GlobalConfig::QuitFlag_G) {
|
||||
if (10 == heart_count) {
|
||||
@ -52,7 +53,12 @@ void CheckThread()
|
||||
data_publish(str.c_str(), GlobalConfig::Topic_G.mPubCmd.c_str());
|
||||
time_check = 0;
|
||||
}
|
||||
|
||||
if(HardStatus == 3600){//one hour 3600
|
||||
JsonData jd;
|
||||
std::string data = jd.JsonCmd_07();
|
||||
data_publish(data.c_str(), GlobalConfig::Topic_G.mPubStatus.c_str());
|
||||
HardStatus = 0;
|
||||
}
|
||||
|
||||
if (21600 == online_check) {
|
||||
JsonData jd;
|
||||
@ -72,7 +78,7 @@ void CheckThread()
|
||||
time_check++;
|
||||
heart_count++;
|
||||
online_check++;
|
||||
|
||||
HardStatus ++;
|
||||
if(GlobalConfig::EnterZigBeeWaveTransmittingFlag_G == ENTER_TRANSMITTING_STATUS) {
|
||||
GlobalConfig::EnterZigBeeWaveTransmittingCnt_G ++;
|
||||
if(GlobalConfig::EnterZigBeeWaveTransmittingCnt_G >= 180) {
|
||||
|
105
uart/SH_Uart.cpp
105
uart/SH_Uart.cpp
@ -418,7 +418,7 @@ void Uart::DealDataNodeInfo(const char *pData)
|
||||
print_info("recv remote zigbee module info\n");
|
||||
RecvData * pRecvData = (RecvData *)pData;
|
||||
char buf[32] = {0};
|
||||
char chTemp = pRecvData->Data[0];
|
||||
char chTemp = pRecvData->Data[0];//设备状态标志 1 byte
|
||||
DataNodeInfo dataNodeInfo;
|
||||
dataNodeInfo.EquipSta = boost::lexical_cast<int>(chTemp >> 2 & 0x1);
|
||||
dataNodeInfo.TemTopFlag = boost::lexical_cast<int>(chTemp >> 3 & 0x1);
|
||||
@ -429,75 +429,114 @@ void Uart::DealDataNodeInfo(const char *pData)
|
||||
|
||||
sprintf(buf, "%02x%02x%02x%02x%02x%02x%02x%02x", pRecvData->Data[1], pRecvData->Data[2], pRecvData->Data[3], pRecvData->Data[4],
|
||||
pRecvData->Data[5], pRecvData->Data[6], pRecvData->Data[7],pRecvData->Data[8]);
|
||||
dataNodeInfo.ZigbeeLongAddr = std::string(buf);
|
||||
dataNodeInfo.ZigbeeLongAddr = std::string(buf);//Zigbee MAC 8 byte
|
||||
|
||||
chTemp = pRecvData->Data[9];
|
||||
chTemp = pRecvData->Data[9];//硬件版本 1 byte
|
||||
memset(buf, 0, 32);
|
||||
sprintf(buf, "%02x", chTemp);
|
||||
dataNodeInfo.HardVersion = std::string(buf);
|
||||
|
||||
chTemp = pRecvData->Data[10];
|
||||
|
||||
chTemp = pRecvData->Data[10];//软件版本 1 byte
|
||||
memset(buf, 0, 32);
|
||||
//sprintf(buf, "%02x", chTemp);
|
||||
sprintf(buf, "%.1f", 0.1*chTemp);
|
||||
dataNodeInfo.SoftVersion = std::string(buf);
|
||||
|
||||
memset(buf, 0, 32);
|
||||
sprintf(buf, "%02x%02x%02x%02x", pRecvData->Data[11], pRecvData->Data[12], pRecvData->Data[13], pRecvData->Data[14]);
|
||||
dataNodeInfo.BpNo = std::string(buf);
|
||||
sprintf(buf, "%d", BUILD_UINT32(pRecvData->Data[11], pRecvData->Data[12], pRecvData->Data[13], pRecvData->Data[14]));
|
||||
dataNodeInfo.BpNo = std::string(buf);//生产批号 4 byte
|
||||
|
||||
memset(buf, 0, 32);
|
||||
sprintf(buf, "%02x%02x%02x%02x", pRecvData->Data[15], pRecvData->Data[16], pRecvData->Data[17], pRecvData->Data[18]);
|
||||
dataNodeInfo.SerialNo = std::string(buf);
|
||||
sprintf(buf, "%d", BUILD_UINT32(pRecvData->Data[15], pRecvData->Data[16], pRecvData->Data[17], pRecvData->Data[18]));
|
||||
dataNodeInfo.SerialNo = std::string(buf);//生产序列号 4 byte
|
||||
|
||||
memset(buf, 0, 32);
|
||||
sprintf(buf, "%02x%02x%02x%02x", pRecvData->Data[19], pRecvData->Data[20], pRecvData->Data[21], pRecvData->Data[22]);
|
||||
dataNodeInfo.FirstPowerTime = std::string(buf);
|
||||
sprintf(buf, "%d", BUILD_UINT32(pRecvData->Data[19], pRecvData->Data[20], pRecvData->Data[21], pRecvData->Data[22]));
|
||||
dataNodeInfo.FirstPowerTime = std::string(buf);//首次上电日期 4 byte
|
||||
|
||||
//23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38=>序号13 无线信号强度
|
||||
|
||||
memset(buf, 0, 32);
|
||||
sprintf(buf, "%d", BUILD_UINT32(pRecvData->Data[23], pRecvData->Data[24], pRecvData->Data[25], pRecvData->Data[26]));
|
||||
dataNodeInfo.WakeupTime = std::string(buf);//唤醒次数 4 byte
|
||||
|
||||
memset(buf, 0, 32);
|
||||
sprintf(buf, "%d", BUILD_UINT32(pRecvData->Data[27], pRecvData->Data[28], pRecvData->Data[29], pRecvData->Data[30]));
|
||||
dataNodeInfo.StaticTime = std::string(buf);//特征值发送次数 4 byte
|
||||
|
||||
memset(buf, 0, 32);
|
||||
sprintf(buf, "%d", BUILD_UINT32(pRecvData->Data[31], pRecvData->Data[32], pRecvData->Data[33], pRecvData->Data[34]));
|
||||
|
||||
dataNodeInfo.WaveTime = std::string(buf);//原始波形发送次数 4 byte
|
||||
|
||||
memset(buf, 0, 32);
|
||||
sprintf(buf, "%02x%02x", pRecvData->Data[35], pRecvData->Data[36]);
|
||||
dataNodeInfo.BateryV = BUILD_UINT16(pRecvData->Data[35],pRecvData->Data[36]);//电池电压 2 byte
|
||||
|
||||
memset(buf, 0, 32);
|
||||
sprintf(buf, "%02x", pRecvData->Data[37]);
|
||||
dataNodeInfo.ProductNo = std::string(buf);//产品型号 1 byte
|
||||
|
||||
// 获取 RSSI
|
||||
chTemp = pRecvData->Data[38];
|
||||
memset(buf, 0, 32);
|
||||
sprintf(buf, "%d", chTemp);
|
||||
dataNodeInfo.RSSI = boost::lexical_cast<int>(buf);
|
||||
dataNodeInfo.RSSI = boost::lexical_cast<int>(buf); //无线信号强度 1 byte
|
||||
|
||||
chTemp = pRecvData->Data[39];
|
||||
memset(buf, 0, 32);
|
||||
sprintf(buf, "%02x", chTemp);
|
||||
dataNodeInfo.ConfigFlag = ((0 == std::string(buf).compare("aa")) ? 1 : 0);
|
||||
dataNodeInfo.ConfigFlag = ((0 == std::string(buf).compare("aa")) ? 1 : 0); //配置标志 1 byte
|
||||
|
||||
memset(buf, 0, 32);
|
||||
sprintf(buf, "%u%u", pRecvData->Data[40], pRecvData->Data[41]);
|
||||
dataNodeInfo.FeatureInterVal = boost::lexical_cast<unsigned int>(buf);
|
||||
dataNodeInfo.FeatureInterVal = boost::lexical_cast<unsigned int>(buf); //唤醒周期 2 byte
|
||||
|
||||
chTemp = pRecvData->Data[42];
|
||||
memset(buf, 0, 32);
|
||||
// sprintf(buf, "%02x", chTemp);
|
||||
sprintf(buf, "%d",(unsigned int)chTemp); // yxq
|
||||
dataNodeInfo.WaveInterVal = boost::lexical_cast<unsigned int>(buf);
|
||||
|
||||
dataNodeInfo.WaveInterVal = boost::lexical_cast<unsigned int>(buf);//原始波形发送周期 2 byte
|
||||
printf("====WaveInterVal = %s\n",buf);
|
||||
memset(buf, 0, 32);
|
||||
sprintf(buf, "%02x%02x", pRecvData->Data[43], pRecvData->Data[44]);
|
||||
sprintf(buf, "%02x%02x", pRecvData->Data[43], pRecvData->Data[44]); //Zigbee PID 2 byte
|
||||
dataNodeInfo.ZigbeePanId = std::string(buf);
|
||||
|
||||
chTemp = pRecvData->Data[45];
|
||||
memset(buf, 0, 32);
|
||||
sprintf(buf, "%d", chTemp);
|
||||
dataNodeInfo.ZigbeeChannel = boost::lexical_cast<int>(buf);
|
||||
dataNodeInfo.ZigbeeChannel = boost::lexical_cast<int>(buf);//Zigbee 信道 1 byte
|
||||
|
||||
memset(buf, 0, 32);
|
||||
sprintf(buf, "%02x%02x", pRecvData->Data[46], pRecvData->Data[47]);
|
||||
sprintf(buf, "%02x%02x", pRecvData->Data[46], pRecvData->Data[47]);//Zigbee 本地地址 2 byte
|
||||
dataNodeInfo.ZigbeeShortAddr = std::string(buf);
|
||||
|
||||
memset(buf, 0, 32);
|
||||
sprintf(buf, "%02x%02x", pRecvData->Data[48], pRecvData->Data[49]);
|
||||
sprintf(buf, "%02x%02x", pRecvData->Data[48], pRecvData->Data[49]);//Zigbee 目标地址 2 byte
|
||||
dataNodeInfo.ZigbeeDesAddr = std::string(buf);
|
||||
//50 51 52=》序号23 zigbee重试间隔
|
||||
|
||||
memset(buf, 0, 32);
|
||||
sprintf(buf, "%02x", pRecvData->Data[50]);//Zigbee 发射功率 1 byte
|
||||
dataNodeInfo.ZigbeePower = boost::lexical_cast<unsigned int>(buf);
|
||||
|
||||
memset(buf, 0, 32);
|
||||
sprintf(buf, "%02x", pRecvData->Data[51]);//Zigbee 重试次数 1 byte
|
||||
dataNodeInfo.ZigbeeRetry = boost::lexical_cast<unsigned int>(buf);
|
||||
|
||||
memset(buf, 0, 32);
|
||||
sprintf(buf, "%02x", pRecvData->Data[52]);//Zigbee 重试间隔 1 byte
|
||||
dataNodeInfo.ZigbeeRetryGap = boost::lexical_cast<unsigned int>(buf);
|
||||
|
||||
chTemp = pRecvData->Data[53];
|
||||
dataNodeInfo.Range = boost::lexical_cast<int>(chTemp >> 2 & 0x3);
|
||||
dataNodeInfo.SamplingRate = boost::lexical_cast<int>(chTemp & 0x3);
|
||||
// 54=》序号25 ACC采样时间
|
||||
memset(buf, 0, 32);
|
||||
sprintf(buf, "%02x", pRecvData->Data[54]);//ACC 采样时间 1 byte
|
||||
dataNodeInfo.ACCSampleTime = boost::lexical_cast<unsigned int>(buf);
|
||||
|
||||
int iTemp = 0;
|
||||
//使用了55 56 59 60 63 64 67 68 71 72
|
||||
for (int i = 0; i < 5; i++) {
|
||||
@ -562,14 +601,22 @@ void Uart::DealDataNodeInfo(const char *pData)
|
||||
if (sql_ctl->GetTableRows(T_SENSOR_INFO(TNAME), whereCon) > 0) {
|
||||
sql_ctl->DeleteTableData(T_SENSOR_INFO(TNAME), whereCon);
|
||||
}
|
||||
|
||||
printf("11111111111\n");
|
||||
char insertSql[1024] = { 0 };
|
||||
sprintf(insertSql, "'%s','%s','%d','%d','%d','%d','%d','%d','%s','%s','%s','%s','%s','%d','%s','%s','%u','%d','%d','%s','%d','%s','%s','%s','%d','%s','%s','%s','%s','%s','%d','%d'",
|
||||
sprintf(insertSql, "'%s','%s','%d','%d','%d','%d','%d','%d',\
|
||||
'%s','%s','%s','%s','%s','%s',\
|
||||
'%s','%d','%d','%s','%d','%s',\
|
||||
'%s','%u','%d','%d','%s','%d','%s','%s',\
|
||||
'%s','%d','%s','%s','%s',\
|
||||
'%d','%d','%d','%d','%s','%s','%d','%d'",
|
||||
dataNodeInfo.ZigbeeLongAddr.c_str(), " ", dataNodeInfo.InitFlag, dataNodeInfo.AccFlag, dataNodeInfo.ZigbeeFlag, dataNodeInfo.TemTopFlag, dataNodeInfo.TemBotFlag,dataNodeInfo.EquipSta,\
|
||||
dataNodeInfo.HardVersion.c_str(), dataNodeInfo.SoftVersion.c_str(), dataNodeInfo.BpNo.c_str(), dataNodeInfo.SerialNo.c_str(), dataNodeInfo.FirstPowerTime.c_str(), dataNodeInfo.ConfigFlag, dataNodeInfo.StartBrands.c_str(), \
|
||||
dataNodeInfo.StopBrands.c_str(), dataNodeInfo.FeatureInterVal, dataNodeInfo.WaveInterVal, dataNodeInfo.SamplingRate, "range", dataNodeInfo.Range, dataNodeInfo.EnvelopeBandPass.c_str(), dataNodeInfo.FaultFrequency.c_str(),\
|
||||
dataNodeInfo.ZigbeePanId.c_str(), dataNodeInfo.ZigbeeChannel, dataNodeInfo.ZigbeeShortAddr.c_str(), dataNodeInfo.ZigbeeLongAddr.c_str(), dataNodeInfo.ZigbeeDesAddr.c_str(), "1", dataNodeInfo.ConfigDate.c_str(),dataNodeInfo.VIntegralFilterFrequency,dataNodeInfo.RSSI);
|
||||
dataNodeInfo.HardVersion.c_str(), dataNodeInfo.SoftVersion.c_str(), dataNodeInfo.BpNo.c_str(), dataNodeInfo.SerialNo.c_str(), dataNodeInfo.FirstPowerTime.c_str(), dataNodeInfo.WakeupTime.c_str(),\
|
||||
dataNodeInfo.StaticTime.c_str(),dataNodeInfo.WaveTime.c_str(),dataNodeInfo.BateryV,dataNodeInfo.ProductNo.c_str(),dataNodeInfo.ConfigFlag, dataNodeInfo.StartBrands.c_str(), \
|
||||
dataNodeInfo.StopBrands.c_str(), dataNodeInfo.FeatureInterVal, dataNodeInfo.WaveInterVal, dataNodeInfo.SamplingRate,"",dataNodeInfo.Range, dataNodeInfo.EnvelopeBandPass.c_str(), dataNodeInfo.FaultFrequency.c_str(),\
|
||||
dataNodeInfo.ZigbeePanId.c_str(), dataNodeInfo.ZigbeeChannel, dataNodeInfo.ZigbeeShortAddr.c_str(), dataNodeInfo.ZigbeeLongAddr.c_str(), dataNodeInfo.ZigbeeDesAddr.c_str(), \
|
||||
dataNodeInfo.ZigbeePower,dataNodeInfo.ZigbeeRetry,dataNodeInfo.ZigbeeRetryGap,dataNodeInfo.ACCSampleTime,"1", dataNodeInfo.ConfigDate.c_str(),dataNodeInfo.VIntegralFilterFrequency,dataNodeInfo.RSSI);
|
||||
sql_ctl->InsertData(T_SENSOR_INFO(TNAME), insertSql);
|
||||
printf("=======insertSql======== %s\n",insertSql);
|
||||
|
||||
Json::Value jsonVal;
|
||||
jsonVal.clear();
|
||||
@ -687,12 +734,12 @@ void Uart::DealDataNodeFeature(const char *pData, int flag)
|
||||
sprintf(buf, "%02x%02x", pRecvData->Data[1], pRecvData->Data[0]);
|
||||
print_blue("@@@@@@@@@@@@@@@@@%s\n",buf);
|
||||
iTemp = (int)strtol(buf, NULL, 16);
|
||||
dataStatic.TemBot = iTemp * 0.0625;
|
||||
dataStatic.TemBot = iTemp * 0.0625;//设备温度
|
||||
|
||||
memset(buf, 0, 8);
|
||||
sprintf(buf, "%02x%02x", pRecvData->Data[3], pRecvData->Data[2]);
|
||||
iTemp = (int)strtol(buf, NULL, 16);
|
||||
dataStatic.TemTop = iTemp * 0.0625;
|
||||
dataStatic.TemTop = iTemp * 0.0625;//环境温度
|
||||
|
||||
memset(buf, 0, 8);
|
||||
sprintf(buf, "%02x%02x", pRecvData->Data[7], pRecvData->Data[6]);
|
||||
@ -1050,7 +1097,7 @@ void Uart::DealDataNodeFeature(const char *pData, int flag)
|
||||
Json::Value valNodeData;
|
||||
Json::Value valNodeFeature;
|
||||
valNodeFeature["dataNodeNo"] = strLongAddr;
|
||||
valNodeFeature["channelID"] = strLongAddr + "-X";
|
||||
valNodeFeature["ChannelId"] = strLongAddr + "-X";
|
||||
valNodeFeature["diagnosisPk"] = dataDymX.DiagnosisPk;
|
||||
valNodeFeature["integratPk"] = dataDymX.IntegratPk;
|
||||
valNodeFeature["integratRMS"] = dataDymX.IntegratRMS;
|
||||
@ -1398,7 +1445,7 @@ void Uart::DealDataNodeFeature(const char *pData, int flag)
|
||||
|
||||
|
||||
valNodeFeature["dataNodeNo"] = strLongAddr;
|
||||
valNodeFeature["channelID"] = strLongAddr + "-Y";
|
||||
valNodeFeature["ChannelId"] = strLongAddr + "-Y";
|
||||
valNodeFeature["diagnosisPk"] = dataDymY.DiagnosisPk;
|
||||
valNodeFeature["integratPk"] = dataDymY.IntegratPk;
|
||||
valNodeFeature["integratRMS"] = dataDymY.IntegratRMS;
|
||||
@ -1747,7 +1794,7 @@ void Uart::DealDataNodeFeature(const char *pData, int flag)
|
||||
|
||||
//无线传感器Z信息
|
||||
valNodeFeature["dataNodeNo"] = strLongAddr;
|
||||
valNodeFeature["channelID"] = strLongAddr + "-Z";
|
||||
valNodeFeature["ChannelId"] = strLongAddr + "-Z";
|
||||
valNodeFeature["diagnosisPk"] = dataDymZ.DiagnosisPk;
|
||||
valNodeFeature["integratPk"] = dataDymZ.IntegratPk;
|
||||
valNodeFeature["integratRMS"] = dataDymZ.IntegratRMS;
|
||||
|
Loading…
x
Reference in New Issue
Block a user