基站数据流插入1005

This commit is contained in:
zms 2025-11-17 17:36:40 +08:00
parent d85cb6b04b
commit 68e9f63929

View File

@ -183,15 +183,35 @@ public class D331RtcmMessageExecutor implements Executor<D331RtcmMessage, Void>
if (logger.isDebugEnabled()) { if (logger.isDebugEnabled()) {
logger.debug("forward d331 rtcm from {} to device {}", deviceBs.getDeviceId(), deviceId); logger.debug("forward d331 rtcm from {} to device {}", deviceBs.getDeviceId(), deviceId);
} }
ByteBuf buf = Unpooled.buffer();
buf.writeBytes(forwardBytes);
//推送策略F9P基站505兼容博通510推送 添加指定基站ID的推送 // 为每个设备生成独立的数据副本确保按需修改如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);
// 推送策略
// 1) 保持原 F9P505 博通510兼容逻辑不变
// 2) 仅对指定基站 ID 追加 1005不影响其它基站
boolean needInsert1005 = false;
if ((deviceBs.getModel()==null || deviceBs.getModel() == GnssDevice.MODEL_G505) && if ((deviceBs.getModel()==null || deviceBs.getModel() == GnssDevice.MODEL_G505) &&
(device.getModel()!=null && device.getModel()==GnssDevice.MODEL_G510)|| (device.getModel()!=null && device.getModel()==GnssDevice.MODEL_G510)) {
TARGET_BASE_STATION_ID_FOR_1005.equals(deviceBs.getDeviceId())){ needInsert1005 = true; // 原兼容逻辑
}
if (TARGET_BASE_STATION_ID_FOR_1005.equals(deviceBs.getDeviceId())) {
needInsert1005 = true; // 仅特定基站额外插入
}
if (needInsert1005) {
buf = insert1005(deviceBs, deviceId, buf); buf = insert1005(deviceBs, deviceId, buf);
} }
// 实际发送到设备通道
deviceChannel.writeAndFlush(buf);
} }
} }
@ -206,7 +226,9 @@ public class D331RtcmMessageExecutor implements Executor<D331RtcmMessage, Void>
//logger.info("Adding D300 string for device: {}", deviceId); //logger.info("Adding D300 string for device: {}", deviceId);
// 获取当前buf中的数据 // 获取当前buf中的数据
byte[] originalData = buf.array(); int readableLen = buf.readableBytes();
byte[] originalData = new byte[readableLen];
buf.getBytes(0, originalData);
String originalHex = ByteUtil.bytesToHexString(originalData); String originalHex = ByteUtil.bytesToHexString(originalData);
// 找到D300和D301的位置 // 找到D300和D301的位置