From 787759d7d333a0ed4d0181f4fd227116da5bba27 Mon Sep 17 00:00:00 2001 From: weidong Date: Tue, 30 Jul 2024 15:02:16 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E5=9B=9E=E9=80=80=EF=BC=8C=E4=B8=8D?= =?UTF-8?q?=E7=94=A8TCP=E6=8E=A8=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../executor/D331RtcmMessageExecutor.java | 33 ++++++------------- 1 file changed, 10 insertions(+), 23 deletions(-) diff --git a/sec-beidou-rtcm/src/main/java/com/imdroid/sideslope/executor/D331RtcmMessageExecutor.java b/sec-beidou-rtcm/src/main/java/com/imdroid/sideslope/executor/D331RtcmMessageExecutor.java index 5a73219b..959993e5 100644 --- a/sec-beidou-rtcm/src/main/java/com/imdroid/sideslope/executor/D331RtcmMessageExecutor.java +++ b/sec-beidou-rtcm/src/main/java/com/imdroid/sideslope/executor/D331RtcmMessageExecutor.java @@ -52,30 +52,17 @@ public class D331RtcmMessageExecutor implements Executor for (Device device : deviceList) { if (device.getOpMode() != GnssDevice.OP_MODE_USE) continue; String deviceId = device.getDeviceId(); - /*if(deviceId.equals("2419385")){ - DeviceChannel channel = OnlineChannels.INSTANCE.getConfigChannel(deviceId); - if(channel != null && channel.isOnline()){ - if (logger.isDebugEnabled()) { - logger.debug("forward d331 rtcm message to device {} tcp", deviceId); - } - ByteBuf buf = Unpooled.buffer(); - buf.writeBytes(forwardBytes); - channel.writeAndFlush(buf); + OnlineChannels.INSTANCE.get(deviceId).ifPresent(deviceChannel -> { + if (logger.isDebugEnabled()) { + logger.debug("forward d331 rtcm message to device {}", deviceId); } - } - else {*/ - OnlineChannels.INSTANCE.get(deviceId).ifPresent(deviceChannel -> { - if (logger.isDebugEnabled()) { - logger.debug("forward d331 rtcm message to device {}", deviceId); - } - if (deviceId.startsWith("2307")) { - forwardBytes[2] = (byte) (forwardBytes[2] & 0x07);//兼容不带序号的测站 - } - ByteBuf buf = Unpooled.buffer(); - buf.writeBytes(forwardBytes); - deviceChannel.writeAndFlush(buf); - }); - //} + if (deviceId.startsWith("2307")) { + forwardBytes[2] = (byte) (forwardBytes[2] & 0x07);//兼容不带序号的测站 + } + ByteBuf buf = Unpooled.buffer(); + buf.writeBytes(forwardBytes); + deviceChannel.writeAndFlush(buf); + }); } }