using HybirdFrameworkCore.Autofac.Attribute; using HybirdFrameworkDriver.TcpServer; using Service.Car.Codec; using Service.Car.Handler; using Service.Car.Msg.Car.Req; using Service.Car.Msg.Car.Resp; namespace Service.Car.Server; [Scope("SingleInstance")] public class CarServer : TcpServer { /// /// 客户端连接状态 /// public bool Connected { get; set; } public string? CarNo { get; set; } public HeartBeatMsg? HeartBeatMsg { get; set; } /// /// 1 待机 2 换电 /// public byte StationStatus { get; set; } /// /// 度电数据车载设备连接上换电站的 Wifi 网络时,主动上送度电数据报文(命令代码: 0x01),发送周期 60s,服务器回复相应的报文(命令代码:0x02) /// public ElecMsg? ElecMsg { get; set; } public LockMsgResp? LockMsgResp { get; set; } public UnLockMsgResp? UnLockMsgResp { get; set; } public SetParamMsgResp? SetParamMsgResp { get; set; } public SettleConfirmMsgResp? SettleConfirmMsgResp { get; set; } public CarServer() : base() { this.ChannelInActiveAction = () => { Connected = false; HeartBeatMsg = null; ElecMsg = null; LockMsgResp = null; UnLockMsgResp = null; SetParamMsgResp = null; SettleConfirmMsgResp = null; }; } }