|
|
|
@ -16,7 +16,7 @@ public class Decoder : ByteToMessageDecoder
|
|
|
|
|
|
|
|
|
|
protected override void Decode(IChannelHandlerContext context, IByteBuffer buffer, List<object> output)
|
|
|
|
|
{
|
|
|
|
|
IByteBuffer? delimiter = FindDelimiter(buffer);
|
|
|
|
|
IByteBuffer delimiter = FindDelimiter(buffer);
|
|
|
|
|
if (delimiter != null)
|
|
|
|
|
{
|
|
|
|
|
//分隔符索引
|
|
|
|
@ -53,12 +53,18 @@ public class Decoder : ByteToMessageDecoder
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
buffer.ReadBytes(data);
|
|
|
|
|
if (PadarMgr._PadarClient!=null)
|
|
|
|
|
{
|
|
|
|
|
PadarMgr._PadarClient.CarState = data[3];
|
|
|
|
|
Log.Info($"receive {BitUtls.BytesToHexStr(data)}:{PadarMgr._PadarClient.CarState}");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PadarMgr._PadarClient.CarState = data[3];
|
|
|
|
|
}
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
Log.Info($"receive {BitUtls.BytesToHexStr(data)}:{PadarMgr._PadarClient.CarState}");
|
|
|
|
|
}
|
|
|
|
|
catch (Exception e) { }
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|