添加日志
This commit is contained in:
parent
f3b6873293
commit
dd0a0b1bb4
|
|
@ -156,14 +156,14 @@ public class MqttCallbackRegistry {
|
|||
// 1. 从存储层获取所有等待该 topic 的回调信息
|
||||
List<MqttCallbackInfo> callbacks = callbackStore.getCallbacksByTopic(topic);
|
||||
|
||||
// 如果是 confirm 消息,打印详细日志
|
||||
if (topic.contains("/control/confirm")) {
|
||||
log.info("【MqttCallbackRegistry】处理confirm消息: topic={}, callbackCount={}, messageBody={}",
|
||||
// 如果是 confirm 或 realTime/data 消息,打印详细日志
|
||||
if (topic.contains("/control/confirm") || topic.contains("/realTime/data")) {
|
||||
log.info("【MqttCallbackRegistry】处理消息: topic={}, callbackCount={}, messageBody={}",
|
||||
topic, callbacks.size(), messageBody);
|
||||
}
|
||||
|
||||
if (callbacks.isEmpty()) {
|
||||
if (topic.contains("/control/confirm")) {
|
||||
if (topic.contains("/control/confirm") || topic.contains("/realTime/data")) {
|
||||
log.warn("【MqttCallbackRegistry】没有找到匹配的回调: topic={}", topic);
|
||||
}
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -283,6 +283,8 @@ public class TuohengService {
|
|||
return;
|
||||
}
|
||||
|
||||
log.info("【状态同步】收到无人机电源状态: sn={}, bPowerON={}", deviceSn, powerOn);
|
||||
|
||||
// 根据 bPowerON 值更新无人机状态
|
||||
// 1 = 开机, 2 = 关机
|
||||
if (powerOn == 1) {
|
||||
|
|
@ -296,7 +298,7 @@ public class TuohengService {
|
|||
currentState == DroneState.ARRIVED ||
|
||||
currentState == DroneState.RETURNING) {
|
||||
stateManager.setDroneState(deviceSn, DroneState.ONLINE);
|
||||
log.debug("同步无人机开机状态: sn={}, powerOn={}, 从 {} 更新为 ONLINE",
|
||||
log.info("【状态同步】同步无人机开机状态: sn={}, powerOn={}, 从 {} 更新为 ONLINE",
|
||||
deviceSn, powerOn, currentState);
|
||||
} else {
|
||||
log.debug("无人机已开机,但当前状态为 {},不更新为 ONLINE", currentState);
|
||||
|
|
@ -308,7 +310,7 @@ public class TuohengService {
|
|||
}
|
||||
} else if (powerOn == 2) {
|
||||
stateManager.setDroneState(deviceSn, DroneState.POWER_OFF);
|
||||
log.debug("同步无人机关机状态: sn={}, powerOn={}", deviceSn, powerOn);
|
||||
log.info("【状态同步】同步无人机关机状态: sn={}, powerOn={}", deviceSn, powerOn);
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue