From 21da58fd8a5b33d7d8c6c86f15d8c4b40affc644 Mon Sep 17 00:00:00 2001 From: yarnom Date: Mon, 17 Nov 2025 17:53:11 +0800 Subject: [PATCH] =?UTF-8?q?Revert=20"=E5=9F=BA=E7=AB=99=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=B5=81=E6=8F=92=E5=85=A51005"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 68e9f63929fce404d80618f53047f1cf1a8a9d7d. --- .../executor/D331RtcmMessageExecutor.java | 32 +++---------------- 1 file changed, 5 insertions(+), 27 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 a8a432b6..8fd81865 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 @@ -183,35 +183,15 @@ public class D331RtcmMessageExecutor implements Executor if (logger.isDebugEnabled()) { logger.debug("forward d331 rtcm from {} to device {}", deviceBs.getDeviceId(), deviceId); } - - // 为每个设备生成独立的数据副本,确保按需修改(如2307)不影响其他设备 - byte[] perDeviceBytes = forwardBytes; - if(deviceId.startsWith("2307")){ - // 处理2307型号的测站,兼容不带序号的测站(修改应发生在写入 ByteBuf 之前) - perDeviceBytes = forwardBytes.clone(); - perDeviceBytes[2] = (byte) (perDeviceBytes[2] & 0x07); - } - ByteBuf buf = Unpooled.buffer(); - buf.writeBytes(perDeviceBytes); + buf.writeBytes(forwardBytes); - // 推送策略: - // 1) 保持原 F9P(505)→ 博通(510)兼容逻辑不变 - // 2) 仅对指定基站 ID 追加 1005(不影响其它基站) - boolean needInsert1005 = false; + //推送策略:F9P基站(505)兼容博通(510)推送 添加指定基站ID的推送 if ((deviceBs.getModel()==null || deviceBs.getModel() == GnssDevice.MODEL_G505) && - (device.getModel()!=null && device.getModel()==GnssDevice.MODEL_G510)) { - needInsert1005 = true; // 原兼容逻辑 - } - if (TARGET_BASE_STATION_ID_FOR_1005.equals(deviceBs.getDeviceId())) { - needInsert1005 = true; // 仅特定基站额外插入 - } - if (needInsert1005) { + (device.getModel()!=null && device.getModel()==GnssDevice.MODEL_G510)|| + TARGET_BASE_STATION_ID_FOR_1005.equals(deviceBs.getDeviceId())){ buf = insert1005(deviceBs, deviceId, buf); } - - // 实际发送到设备通道 - deviceChannel.writeAndFlush(buf); } } @@ -226,9 +206,7 @@ public class D331RtcmMessageExecutor implements Executor //logger.info("Adding D300 string for device: {}", deviceId); // 获取当前buf中的数据 - int readableLen = buf.readableBytes(); - byte[] originalData = new byte[readableLen]; - buf.getBytes(0, originalData); + byte[] originalData = buf.array(); String originalHex = ByteUtil.bytesToHexString(originalData); // 找到D300和D301的位置