增加日志存储容量,新增校时接口
This commit is contained in:
parent
f0753e8701
commit
40ab840cd8
@ -20,7 +20,7 @@ enum enumZigBeeTransmitStatus {
|
||||
|
||||
|
||||
//#define NR5G_MODULE
|
||||
//#define Q4G_MODULE
|
||||
#define Q4G_MODULE
|
||||
//#define WIFI_MODULE
|
||||
//#define NR5G_MEIGE
|
||||
//#define G2UL_GATEWAY
|
||||
|
@ -942,6 +942,11 @@ int SqliteDB::CalculateBattery()
|
||||
print_info("已经使用 = %f\n",atof(vecResSig[6].c_str()));
|
||||
|
||||
float remainBattery = capacity - usageBattery * 0.2;
|
||||
if (remainBattery < 10)
|
||||
{
|
||||
remainBattery = 10;
|
||||
}
|
||||
|
||||
LOG_INFO("dataNodeNo = %s,batteryUsage = %f,batteryRemain = %f\n",vecRes[i][0].c_str(),atof(vecResSig[6].c_str()),remainBattery);
|
||||
memset(whereCon,0x00,sizeof(whereCon));
|
||||
sprintf(whereCon," dataNodeNo = '%s' order by timeStamp desc limit 0,1 ",vecRes[i][0].c_str());
|
||||
|
2
main.cpp
2
main.cpp
@ -38,7 +38,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
// 设置线程属性之栈空间大小
|
||||
boost::thread::attributes attrs;
|
||||
attrs.set_stack_size(1024*1024*2);
|
||||
attrs.set_stack_size(1024*1024);
|
||||
|
||||
// 初始化平台配置文件
|
||||
platform->PlatFormInit();
|
||||
|
@ -83,12 +83,18 @@ void CheckThread()
|
||||
#endif
|
||||
if (300 == time_check) {
|
||||
char buf[256] = {0};
|
||||
char buf2[256] = {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());
|
||||
std::string str = std::string(buf);
|
||||
std::string str2 = std::string(buf2);
|
||||
time_check = 0;
|
||||
int iRet = data_publish(str.c_str(), GlobalConfig::Topic_G.mPubTiming.c_str());
|
||||
iRet = data_publish(str.c_str(), GlobalConfig::Topic_G.mPubCmd.c_str());
|
||||
iRet = data_publish(str2.c_str(), GlobalConfig::Topic_G.mPubTiming.c_str());
|
||||
iRet = data_publish(str2.c_str(), GlobalConfig::Topic_G.mPubCmd.c_str());
|
||||
if(iRet != 0 )
|
||||
{
|
||||
LOG_ERROR("MQTT connect failed ,time check\n");
|
||||
|
Loading…
x
Reference in New Issue
Block a user