[change] 添加下发到工控机命令判断,非PB协议数据一律不做转发,避免会引起工控机异常

This commit is contained in:
xinfengkun
2022-08-10 16:46:32 +08:00
parent 6b9a1d79c1
commit aa57b7a970

View File

@@ -246,6 +246,10 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
return false;
}
ByteString byteString = ByteString.of(bytes);
if (!byteString.startsWith(Constants.RAW_MG)) {
CupidLogUtils.e(TAG, "协议不匹配,命令下发失败 bytes=" + ByteUtil.byteArrToHex(bytes));
return false;
}
return mSocket.sendDataWebSocket(byteString);
}