using DotNetty.Buffers;
using DotNetty.Codecs;
using DotNetty.Transport.Channels;
using HybirdFrameworkCore.Utils;
using HybirdFrameworkDriver.Session;
using log4net;
using Newtonsoft.Json;
using Service.Charger.Client;
using Service.Charger.Msg;
using Service.Charger.Msg.Charger.Req;
using Service.Charger.Msg.Charger.Resp;
namespace Service.Charger.Codec;
///
/// 解码器
///
public class Decoder : ByteToMessageDecoder
{
private readonly IByteBuffer[] _delimiters = { Unpooled.CopiedBuffer(PlcConst.StartChar) };
///
///
///
///
///
private ILog Log(string? chargerSn)
{
if (ObjUtils.IsNotNullOrWhiteSpace(chargerSn))
{
//return LogManager.GetLogger("Plc" + chargerSn);
return LogManager.GetLogger("Plc");
}
return LogManager.GetLogger(typeof(Decoder));
}
#region MyRegion
#endregion
protected override void Decode(IChannelHandlerContext context, IByteBuffer buffer, List