Compare commits

..

No commits in common. "f81e541cad18425ee26e005d44498ad93352cb5d" and "9336ed819ce1440d9f01c0d1fc4c6b3008862d4e" have entirely different histories.

View File

@ -187,11 +187,17 @@ public class D331RtcmMessageExecutor implements Executor<D331RtcmMessage, Void>
buf.writeBytes(forwardBytes);
//推送策略F9P基站505兼容博通510推送 添加指定基站ID的推送
if ((deviceBs.getModel()==null || deviceBs.getModel() == GnssDevice.MODEL_G505) &&
(device.getModel()!=null && device.getModel()==GnssDevice.MODEL_G510)||
TARGET_BASE_STATION_ID_FOR_1005.equals(deviceBs.getDeviceId())){
// 避免修改共享的 forwardBytes针对 2307 机型仅修改本次缓冲区
if (deviceId.startsWith("2307") && buf.readableBytes() > 2) {
buf.setByte(2, (byte) (buf.getByte(2) & 0x07));
}
if (((deviceBs.getModel()==null || deviceBs.getModel() == GnssDevice.MODEL_G505) &&
(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);
}
}
@ -206,8 +212,11 @@ public class D331RtcmMessageExecutor implements Executor<D331RtcmMessage, Void>
//logger.info("Adding D300 string for device: {}", deviceId);
// 获取当前buf中的数据
byte[] originalData = buf.array();
String originalHex = ByteUtil.bytesToHexString(originalData);
int readerIndex = buf.readerIndex();
int readable = buf.readableBytes();
byte[] originalData = new byte[readable];
buf.getBytes(readerIndex, originalData);
String originalHex = ByteUtil.bytesToHexString(originalData).toLowerCase(java.util.Locale.ROOT);
// 找到D300和D301的位置
int d300Index = originalHex.indexOf("d300");
@ -230,7 +239,7 @@ public class D331RtcmMessageExecutor implements Executor<D331RtcmMessage, Void>
if (insertIndex != -1) {
// 创建新的buf
buf1005 = Unpooled.buffer();
buf1005 = Unpooled.buffer(originalData.length + 64);
// 写入D300/D301之前的数据
buf1005.writeBytes(originalData, 0, insertIndex / 2);
@ -252,14 +261,14 @@ public class D331RtcmMessageExecutor implements Executor<D331RtcmMessage, Void>
// 写入剩余的数据
buf1005.writeBytes(originalData, insertIndex / 2, originalData.length - insertIndex / 2);
// 添加日志记录插入位置和完整数据
logger.info("Inserted RTCM 1005 message before position {}, complete data: {}",
insertIndex,
ByteUtil.bytesToHexString(buf.array()));
}
// 更新最后转发时间仅在成功插入时
lastD300ForwardTimeMap.put(deviceId, currentTime);
// 更新最后转发时间
lastD300ForwardTimeMap.put(deviceId, currentTime);
// 添加日志记录插入位置和完整数据
// logger.info("Inserted RTCM 1005 message before position {}, complete data: {}",
// insertIndex,
// ByteUtil.bytesToHexString(buf.array()));
}
// 添加日志记录测站转发的完整数据
//logger.info("Forward data to device: {}, time: {}, complete data: {}",