using HybirdFrameworkCore.Autofac.Attribute;
using HybirdFrameworkDriver.Session;
using HybirdFrameworkDriver.TcpClient;
using Service.Charger.Codec;
using Service.Charger.Handler;
namespace Service.Charger.Client;
///
/// 示例程序
///
[Scope("InstancePerDependency")]
public class ChargerClient : TcpClient
{
public void SessionAttr(int sn, int fEqmTypeNo, string eqmCode, string destAddr)
{
IoSession? ioSession = SessionMgr.GetSession(this.Channel.Id.ToString());
if (ioSession == null)
{
ioSession = new IoSession(this.Channel);
SessionMgr.RegisterSession(this.Channel, ioSession);
}
SessionMgr.SetAttr(ioSession, "charger_sn", sn);
SessionMgr.SetAttr(ioSession, "eqm_type_no", fEqmTypeNo);
SessionMgr.SetAttr(ioSession, "eqm_code", eqmCode);
SessionMgr.SetAttr(ioSession, "dest_addr", destAddr);
}
}