|
|
@ -10,8 +10,6 @@ using Service.Charger.Msg;
|
|
|
|
using Service.Charger.Msg.Bms;
|
|
|
|
using Service.Charger.Msg.Bms;
|
|
|
|
using Service.Charger.Msg.Charger.Req;
|
|
|
|
using Service.Charger.Msg.Charger.Req;
|
|
|
|
using Service.Charger.Msg.Charger.Resp;
|
|
|
|
using Service.Charger.Msg.Charger.Resp;
|
|
|
|
using Service.Charger.Msg.Host.Req;
|
|
|
|
|
|
|
|
using static System.Net.Mime.MediaTypeNames;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace Service.Charger.Codec;
|
|
|
|
namespace Service.Charger.Codec;
|
|
|
|
|
|
|
|
|
|
|
@ -48,6 +46,11 @@ public class Decoder : ByteToMessageDecoder
|
|
|
|
int frameLength = buffer.GetUnsignedShortLE(buffer.ReaderIndex + frameLengthIndex);
|
|
|
|
int frameLength = buffer.GetUnsignedShortLE(buffer.ReaderIndex + frameLengthIndex);
|
|
|
|
//总帧长
|
|
|
|
//总帧长
|
|
|
|
int totalFrameLength = delimiterIndex + delimiter.Capacity + 2 + frameLength;
|
|
|
|
int totalFrameLength = delimiterIndex + delimiter.Capacity + 2 + frameLength;
|
|
|
|
|
|
|
|
// 最小总帧长过滤
|
|
|
|
|
|
|
|
if (totalFrameLength < 24)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (buffer.ReadableBytes < totalFrameLength)
|
|
|
|
if (buffer.ReadableBytes < totalFrameLength)
|
|
|
|
{
|
|
|
|
{
|
|
|
|