如果控制消息从数据通道来,则删除其控制通道信息,确保服务器信令也从数据通道发
This commit is contained in:
parent
27a951df21
commit
8cfdbb89f3
@ -37,8 +37,6 @@ public class D3F0SelfCheckMessageExecutor implements Executor<D3F0SelfCheckMessa
|
|||||||
@Resource(name = "local")
|
@Resource(name = "local")
|
||||||
private DeviceService deviceService;
|
private DeviceService deviceService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private GnssGroupMapper gnssGroupMapper;
|
|
||||||
@Autowired
|
|
||||||
RtcmClient rtcmClient;
|
RtcmClient rtcmClient;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -96,7 +94,7 @@ public class D3F0SelfCheckMessageExecutor implements Executor<D3F0SelfCheckMessa
|
|||||||
logger.debug("设备" + device.getDeviceId() + ": F9P 最近一次断电时间初始化为 " + device.getLastF9PPowerOffTime());
|
logger.debug("设备" + device.getDeviceId() + ": F9P 最近一次断电时间初始化为 " + device.getLastF9PPowerOffTime());
|
||||||
}
|
}
|
||||||
// 检查 F9P 最近一次断电时间是否超过 48 小时 ,若是,则发送断电指令
|
// 检查 F9P 最近一次断电时间是否超过 48 小时 ,若是,则发送断电指令
|
||||||
else if(device.getLastF9PPowerOffTime().isBefore(now.minusHours(48))){
|
else if(device.getLastF9PPowerOffTime().isBefore(now.minusHours(24))){
|
||||||
logger.debug("设备 "+device.getDeviceId()+" 的 F9P 距离上一次断电已超过48小时,发送F9P断电指令");
|
logger.debug("设备 "+device.getDeviceId()+" 的 F9P 距离上一次断电已超过48小时,发送F9P断电指令");
|
||||||
sendF9PPowerOffCommand(device);
|
sendF9PPowerOffCommand(device);
|
||||||
// 更新F9P断电时间,用于下一个48小时周期后的判断
|
// 更新F9P断电时间,用于下一个48小时周期后的判断
|
||||||
|
|||||||
@ -51,6 +51,10 @@ public class OnlineChannels {
|
|||||||
return deviceChannel;
|
return deviceChannel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void removeConfigChannel(String deviceId){
|
||||||
|
configChannels.remove(deviceId);
|
||||||
|
}
|
||||||
|
|
||||||
public Optional<DeviceChannel> get(String deviceId) {
|
public Optional<DeviceChannel> get(String deviceId) {
|
||||||
return Optional.ofNullable(dataChannels.get(deviceId));
|
return Optional.ofNullable(dataChannels.get(deviceId));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -40,6 +40,10 @@ public class RtcmUdpHandler extends ChannelInboundHandlerAdapter {
|
|||||||
// 消息解析
|
// 消息解析
|
||||||
BaseMessage message = MessageParser.instance.parse(packet.content());
|
BaseMessage message = MessageParser.instance.parse(packet.content());
|
||||||
OnlineChannels.INSTANCE.updateDataChannel(message.getId(), ctx.channel(), packet.sender());
|
OnlineChannels.INSTANCE.updateDataChannel(message.getId(), ctx.channel(), packet.sender());
|
||||||
|
if(message.getHeader() == 0xd3f0){
|
||||||
|
//如果控制消息从数据通道来,则删除其控制通道信息,确保服务器信令也从数据通道发
|
||||||
|
OnlineChannels.INSTANCE.removeConfigChannel(message.getId());
|
||||||
|
}
|
||||||
BizExecutors.execute(message);
|
BizExecutors.execute(message);
|
||||||
} catch (UnSupportedMessageException e) {
|
} catch (UnSupportedMessageException e) {
|
||||||
logger.warn("receive un supported message: {}", e.getMessage());
|
logger.warn("receive un supported message: {}", e.getMessage());
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user