测试:2419385串口1统计没有收到d331,改用TCP推d331
This commit is contained in:
parent
011a49e008
commit
4f3eeaef93
@ -7,6 +7,7 @@ import com.imdroid.sideslope.bd.Gga;
|
|||||||
import com.imdroid.sideslope.message.D331RtcmMessage;
|
import com.imdroid.sideslope.message.D331RtcmMessage;
|
||||||
import com.imdroid.sideslope.sal.Device;
|
import com.imdroid.sideslope.sal.Device;
|
||||||
import com.imdroid.sideslope.sal.DeviceService;
|
import com.imdroid.sideslope.sal.DeviceService;
|
||||||
|
import com.imdroid.sideslope.server.DeviceChannel;
|
||||||
import com.imdroid.sideslope.server.OnlineChannels;
|
import com.imdroid.sideslope.server.OnlineChannels;
|
||||||
import com.imdroid.sideslope.service.DataPersistService;
|
import com.imdroid.sideslope.service.DataPersistService;
|
||||||
import io.netty.buffer.ByteBuf;
|
import io.netty.buffer.ByteBuf;
|
||||||
@ -52,17 +53,27 @@ public class D331RtcmMessageExecutor implements Executor<D331RtcmMessage, Void>
|
|||||||
for (Device device : deviceList) {
|
for (Device device : deviceList) {
|
||||||
if (device.getOpMode() != GnssDevice.OP_MODE_USE) continue;
|
if (device.getOpMode() != GnssDevice.OP_MODE_USE) continue;
|
||||||
String deviceId = device.getDeviceId();
|
String deviceId = device.getDeviceId();
|
||||||
OnlineChannels.INSTANCE.get(deviceId).ifPresent(deviceChannel -> {
|
if(deviceId.equals("2419385")){
|
||||||
if (logger.isDebugEnabled()) {
|
DeviceChannel channel = OnlineChannels.INSTANCE.getConfigChannel(deviceId);
|
||||||
logger.debug("forward d331 rtcm message to device {}", deviceId);
|
if(channel != null && channel.isOnline()){
|
||||||
|
ByteBuf buf = Unpooled.buffer();
|
||||||
|
buf.writeBytes(forwardBytes);
|
||||||
|
channel.writeAndFlush(buf);
|
||||||
}
|
}
|
||||||
if(deviceId.startsWith("2307")){
|
}
|
||||||
forwardBytes[2] = (byte) (forwardBytes[2]&0x07);//兼容不带序号的测站
|
else {
|
||||||
}
|
OnlineChannels.INSTANCE.get(deviceId).ifPresent(deviceChannel -> {
|
||||||
ByteBuf buf = Unpooled.buffer();
|
if (logger.isDebugEnabled()) {
|
||||||
buf.writeBytes(forwardBytes);
|
logger.debug("forward d331 rtcm message to device {}", deviceId);
|
||||||
deviceChannel.writeAndFlush(buf);
|
}
|
||||||
});
|
if (deviceId.startsWith("2307")) {
|
||||||
|
forwardBytes[2] = (byte) (forwardBytes[2] & 0x07);//兼容不带序号的测站
|
||||||
|
}
|
||||||
|
ByteBuf buf = Unpooled.buffer();
|
||||||
|
buf.writeBytes(forwardBytes);
|
||||||
|
deviceChannel.writeAndFlush(buf);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user