[Change]移除乘客端Json数据转发

This commit is contained in:
xinfengkun
2022-04-07 17:58:22 +08:00
parent 2d63e9eb18
commit 18ad75b437
2 changed files with 7 additions and 30 deletions

View File

@@ -301,14 +301,6 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
} catch (Exception e) {
e.printStackTrace();
}
// TODO 临时接续Json数据传递添加的Header 0x00表示PB数据 0x01表示Json数据
if (!adasOptions.isClient() && onMultiDeviceListener != null) {
byte[] bytes = text.getBytes(StandardCharsets.UTF_8);
byte[] temp = new byte[bytes.length + 1];
System.arraycopy(bytes, 0, temp, 1, bytes.length);
temp[0] = 0x01;
onMultiDeviceListener.onForwardingIPCMessage(temp);
}
}
/**
@@ -321,19 +313,6 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
if (bytes == null || bytes.length == 0) {
return;
}
//TODO 临时将Json数据转发并解析 0x00表示PB数据 0x01表示Json数据
if (adasOptions.isClient()) {
byte header = bytes[0];
byte[] temp = new byte[bytes.length - 1];
System.arraycopy(bytes, 1, temp, 0, temp.length);
bytes = temp;
if (header != 0x00) {
//Json 解析
handlerWSMsg(new String(bytes, StandardCharsets.UTF_8));
return;
}
}
//PB解析
ByteString byteString = ByteString.of(bytes);
try {
if (rawUnpack != null) {
@@ -417,11 +396,7 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
byte[] bytes1 = bytes.toByteArray();
parseIPCData(bytes1);
if (!adasOptions.isClient() && onMultiDeviceListener != null) {
// TODO 临时接续Json数据传递添加的Header 0x00表示PB数据 0x01表示Json数据
byte[] temp = new byte[bytes1.length + 1];
System.arraycopy(bytes1, 0, temp, 1, bytes1.length);
temp[0] = 0x00;
onMultiDeviceListener.onForwardingIPCMessage(temp);
onMultiDeviceListener.onForwardingIPCMessage(bytes1);
}
}