add codes
This commit is contained in:
parent
4de0f19d9c
commit
493da71a81
@ -234,7 +234,7 @@ void JsonData::CmtCmd_83(char* recv_body,int& count,char* send_data,int& send_le
|
||||
printf("count = %d\n",count);
|
||||
char MeasurementID_[256]={0};
|
||||
for (size_t i = 0; i < count; i++){
|
||||
char temp[5]={0};
|
||||
char temp[21]={0};
|
||||
memcpy(temp,recv_body + i * 20,20);
|
||||
printf("short_addr = %s\n",temp);
|
||||
strcat(MeasurementID_,"'");
|
||||
|
||||
9
main.cpp
9
main.cpp
@ -18,7 +18,6 @@
|
||||
#include "dbaccess/sql_db.hpp"
|
||||
#include "uart/uart.hpp"
|
||||
#include "minilzo/minilzo.h"
|
||||
#include "scheduler/schedule.hpp"
|
||||
|
||||
extern std::vector<RecvData> g_VecWaveDataX;
|
||||
extern std::vector<RecvData> g_VecWaveDataY;
|
||||
@ -28,6 +27,7 @@ zlog_category_t *zct = NULL;
|
||||
zlog_category_t *zbt = NULL;
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
|
||||
int rc = zlog_init("/opt/configenv/wlg.conf");
|
||||
if (rc) {
|
||||
printf("init failed\n");
|
||||
@ -44,7 +44,6 @@ int main(int argc, char *argv[]) {
|
||||
|
||||
zlog_info(zbt, " Firmware compile time:%s %s,version %s", __DATE__, __TIME__, GlobalConfig::Version.c_str());
|
||||
zlog_info(zbt, "####CIDNSOFT start####");
|
||||
return 0;
|
||||
|
||||
g_VecWaveDataX.reserve(1000);
|
||||
g_VecWaveDataY.reserve(1000);
|
||||
@ -117,9 +116,9 @@ int main(int argc, char *argv[]) {
|
||||
boost::thread startTcpCgi(attrs, StartCgiServer);
|
||||
startTcpCgi.detach();
|
||||
|
||||
//启动CMT server
|
||||
boost::thread startTcpCmt(attrs, StartCMTServer);
|
||||
startTcpCmt.detach();
|
||||
// //启动CMT server
|
||||
// boost::thread startTcpCmt(attrs, StartCMTServer);
|
||||
// startTcpCmt.detach();
|
||||
|
||||
sleep(5);
|
||||
uart_inst::instance().ZigbeeParameterConfig();
|
||||
|
||||
@ -544,28 +544,28 @@ int SensorScheduler::UpdateConfigResult(int short_addr, int result) {
|
||||
int SensorScheduler::UpgradeSensor(int short_addr, std::string sensor_type, int hw_version,
|
||||
std::string current_sw_version, std::string upgrade_sw_version) {
|
||||
int id = 0;
|
||||
// auto iter = short_addr_map_.find(short_addr);
|
||||
// if (iter == short_addr_map_.end()) {
|
||||
// zlog_error(zct, "cannot find id for short_addr %x", short_addr);
|
||||
// return 1;
|
||||
// } else {
|
||||
// id = iter->second;
|
||||
// }
|
||||
// zlog_info(zbt, "[%d] short addr:%x sensor_type = %s,hw_version = %d,\
|
||||
// current_sw_version = %s,upgrade_sw_version = %s", id, short_addr,\
|
||||
// sensor_type.c_str(),hw_version,current_sw_version.c_str(),upgrade_sw_version.c_str());
|
||||
// UpgradeInfo info;
|
||||
// info.try_times = 0;
|
||||
// info.sensor_type = sensor_type;
|
||||
// info.hw_version = hw_version;
|
||||
// info.current_sw_version = current_sw_version;
|
||||
// info.upgrade_sw_version = upgrade_sw_version;
|
||||
// long ts = GetLocalTs();
|
||||
// info.submit_time = GetUTCTime(ts);
|
||||
// upgrade_[id] = info;
|
||||
// zlog_info(zbt, "[%d] short addr:%x add upgrade info", id, short_addr);
|
||||
// UpgradeCfg::WriteCfg(upgrade_);
|
||||
//zlog_info(zbt, "[%d] 222short addr:%x add upgrade info", id, short_addr);
|
||||
auto iter = short_addr_map_.find(short_addr);
|
||||
if (iter == short_addr_map_.end()) {
|
||||
zlog_error(zct, "cannot find id for short_addr %x", short_addr);
|
||||
return 1;
|
||||
} else {
|
||||
id = iter->second;
|
||||
}
|
||||
zlog_info(zbt, "[%d] short addr:%x sensor_type = %s,hw_version = %d,\
|
||||
current_sw_version = %s,upgrade_sw_version = %s", id, short_addr,\
|
||||
sensor_type.c_str(),hw_version,current_sw_version.c_str(),upgrade_sw_version.c_str());
|
||||
UpgradeInfo info;
|
||||
info.try_times = 0;
|
||||
info.sensor_type = sensor_type;
|
||||
info.hw_version = hw_version;
|
||||
info.current_sw_version = current_sw_version;
|
||||
info.upgrade_sw_version = upgrade_sw_version;
|
||||
long ts = GetLocalTs();
|
||||
info.submit_time = GetUTCTime(ts);
|
||||
upgrade_[id] = info;
|
||||
zlog_info(zbt, "[%d] short addr:%x add upgrade info", id, short_addr);
|
||||
UpgradeCfg::WriteCfg(upgrade_);
|
||||
zlog_info(zbt, "[%d] 222short addr:%x add upgrade info", id, short_addr);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user