From 8b6ce7f0afb345bbc0bcf021696de25fc8555ae7 Mon Sep 17 00:00:00 2001 From: pandx Date: Tue, 5 Nov 2024 14:53:47 +0800 Subject: [PATCH] fix build issue. --- jsonparse/mqtt_cmd_parse.cpp | 5 ++++- scheduler/short_addr_cfg.cpp | 7 ++++--- scheduler/update_cfg.cpp | 1 + scheduler/upgrade_cfg.cpp | 1 + 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/jsonparse/mqtt_cmd_parse.cpp b/jsonparse/mqtt_cmd_parse.cpp index dfbed36..9c155d2 100644 --- a/jsonparse/mqtt_cmd_parse.cpp +++ b/jsonparse/mqtt_cmd_parse.cpp @@ -402,12 +402,15 @@ std::string JsonData::JsonCmd_52() { if (count < 1) { 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++) { Json::Value jsSensor; std::string strDataNodeNo = ""; jsonVal.clear(); jsonVal["cmd"] = "52"; - memcpy(whereCon, "sendMsg = '0' ORDER BY timeStamp DESC LIMIT 0,3", sizeof(whereCon)); + // 自数据库获取传感器特征数据 array_t arrRes; arrRes = sqlite_db_ctrl::instance().GetDataMultiLine(T_DATA_INFO(TNAME), "*", whereCon); diff --git a/scheduler/short_addr_cfg.cpp b/scheduler/short_addr_cfg.cpp index 2c05713..a3529f7 100644 --- a/scheduler/short_addr_cfg.cpp +++ b/scheduler/short_addr_cfg.cpp @@ -1,4 +1,5 @@ #include "short_addr_cfg.hpp" +#include #include #include @@ -16,16 +17,16 @@ int ShortAddrCfg::ReadCfg(std::map& short_addr_map) { if (!reader.parse(base_relation_file, root, false)) { zlog_error(zbt, "[ShortAddrCfg] invalid format, fail to parse %s", BASE_RELATION); base_relation_file.close(); - return; + return 1; } base_relation_file.close(); if (!root.isArray()) { zlog_error(zbt, "[ShortAddrCfg] invalid format, not an array: %s", BASE_RELATION); - return; + return 2; } if (root.size() == 0) { zlog_info(zbt, "[ShortAddrCfg] no element in %s", BASE_RELATION); - return; + return 0; } uint16_t short_addr; diff --git a/scheduler/update_cfg.cpp b/scheduler/update_cfg.cpp index c6a0481..4f40eca 100644 --- a/scheduler/update_cfg.cpp +++ b/scheduler/update_cfg.cpp @@ -1,4 +1,5 @@ #include "update_cfg.hpp" +#include #include #include diff --git a/scheduler/upgrade_cfg.cpp b/scheduler/upgrade_cfg.cpp index c5d913c..3ff331b 100644 --- a/scheduler/upgrade_cfg.cpp +++ b/scheduler/upgrade_cfg.cpp @@ -1,4 +1,5 @@ #include "upgrade_cfg.hpp" +#include #include #include