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.

29 lines
949 B

6 months ago
using HybirdFrameworkCore.Autofac.Attribute;
using HybirdFrameworkDriver.Session;
using HybirdFrameworkDriver.TcpClient;
using Service.Charger.Codec;
using Service.Charger.Handler;
6 months ago
namespace Service.Charger.Client;
6 months ago
/// <summary>
6 months ago
/// 示例程序
6 months ago
/// </summary>
[Scope("InstancePerDependency")]
public class ChargerClient : TcpClient<IBaseHandler, Decoder, Encoder>
{
public void SessionAttr(int sn, int fEqmTypeNo, string eqmCode, string destAddr)
{
6 months ago
var ioSession = SessionMgr.GetSession(Channel.Id.ToString());
6 months ago
if (ioSession == null)
{
6 months ago
ioSession = new IoSession(Channel);
SessionMgr.RegisterSession(Channel, ioSession);
6 months ago
}
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);
}
}