fix build issue.

This commit is contained in:
pandx 2024-11-05 14:53:47 +08:00
parent 2a7eda0060
commit 8b6ce7f0af
4 changed files with 10 additions and 4 deletions

View File

@ -402,12 +402,15 @@ std::string JsonData::JsonCmd_52() {
if (count < 1) { if (count < 1) {
return ""; return "";
} }
std::string tmp_cond;
tmp_cond = "sendMsg = '0' ORDER BY timeStamp DESC LIMIT 0,3";
memcpy(whereCon, tmp_cond.c_str(), tmp_cond.length());
for (int i = 0; i < count; i++) { for (int i = 0; i < count; i++) {
Json::Value jsSensor; Json::Value jsSensor;
std::string strDataNodeNo = ""; std::string strDataNodeNo = "";
jsonVal.clear(); jsonVal.clear();
jsonVal["cmd"] = "52"; jsonVal["cmd"] = "52";
memcpy(whereCon, "sendMsg = '0' ORDER BY timeStamp DESC LIMIT 0,3", sizeof(whereCon));
// 自数据库获取传感器特征数据 // 自数据库获取传感器特征数据
array_t arrRes; array_t arrRes;
arrRes = sqlite_db_ctrl::instance().GetDataMultiLine(T_DATA_INFO(TNAME), "*", whereCon); arrRes = sqlite_db_ctrl::instance().GetDataMultiLine(T_DATA_INFO(TNAME), "*", whereCon);

View File

@ -1,4 +1,5 @@
#include "short_addr_cfg.hpp" #include "short_addr_cfg.hpp"
#include <fstream>
#include <json/json.h> #include <json/json.h>
#include <zlog.h> #include <zlog.h>
@ -16,16 +17,16 @@ int ShortAddrCfg::ReadCfg(std::map<uint16_t, int>& short_addr_map) {
if (!reader.parse(base_relation_file, root, false)) { if (!reader.parse(base_relation_file, root, false)) {
zlog_error(zbt, "[ShortAddrCfg] invalid format, fail to parse %s", BASE_RELATION); zlog_error(zbt, "[ShortAddrCfg] invalid format, fail to parse %s", BASE_RELATION);
base_relation_file.close(); base_relation_file.close();
return; return 1;
} }
base_relation_file.close(); base_relation_file.close();
if (!root.isArray()) { if (!root.isArray()) {
zlog_error(zbt, "[ShortAddrCfg] invalid format, not an array: %s", BASE_RELATION); zlog_error(zbt, "[ShortAddrCfg] invalid format, not an array: %s", BASE_RELATION);
return; return 2;
} }
if (root.size() == 0) { if (root.size() == 0) {
zlog_info(zbt, "[ShortAddrCfg] no element in %s", BASE_RELATION); zlog_info(zbt, "[ShortAddrCfg] no element in %s", BASE_RELATION);
return; return 0;
} }
uint16_t short_addr; uint16_t short_addr;

View File

@ -1,4 +1,5 @@
#include "update_cfg.hpp" #include "update_cfg.hpp"
#include <fstream>
#include <json/json.h> #include <json/json.h>
#include <zlog.h> #include <zlog.h>

View File

@ -1,4 +1,5 @@
#include "upgrade_cfg.hpp" #include "upgrade_cfg.hpp"
#include <fstream>
#include <json/json.h> #include <json/json.h>
#include <zlog.h> #include <zlog.h>