first commit

This commit is contained in:
cxh 2025-09-09 14:04:59 +08:00
parent cdd3961550
commit 6be2795468

View File

@ -33,14 +33,14 @@ static void on_mqtt_message_received(const std::string &topic, const std::string
// 处理 video_down // 处理 video_down
auto j = nlohmann::json::parse(message); auto j = nlohmann::json::parse(message);
if (!j.contains("data") || !j["data"].contains("status")) if (!j.contains("data") || !j["data"].contains("status") || !j["data"].contains("seqNo"))
{ {
LOG_WARN("[MQTT] video_down JSON missing data.status"); LOG_WARN("[MQTT] video_down JSON missing required fields");
return; return;
} }
int status = j["data"]["status"].get<int>(); int status = j["data"]["status"].get<int>();
std::string seqNo = j["seqNo"].get<std::string>(); std::string seqNo = j["data"]["seqNo"].get<std::string>();
bool success = true; // 标记是否操作成功 bool success = true; // 标记是否操作成功
if (status == 0) if (status == 0)