You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
497 B

using DotNetty.Buffers;
using DotNetty.Codecs;
using DotNetty.Transport.Channels;
7 months ago
using HybirdFrameworkDriver.Common;
using HybirdFrameworkDriver.Session;
namespace Service.Charger.Codec;
7 months ago
public class Encoder : MessageToByteEncoder<IToBytes>
{
7 months ago
protected override void Encode(IChannelHandlerContext context, IToBytes obj, IByteBuffer output)
{
int sn = (int)SessionMgr.GetAttrByKey(context.Channel.Id.ToString(), "charger_sn");
7 months ago
output.WriteBytes(obj.ToBytes());
}
}