parent
4942e09aba
commit
0a61c7d888
@ -0,0 +1,35 @@
|
||||
using DotNetty.Transport.Channels;
|
||||
using HybirdFrameworkCore.Autofac.Attribute;
|
||||
using HybirdFrameworkCore.Utils;
|
||||
using log4net;
|
||||
using Newtonsoft.Json;
|
||||
using Service.Charger.Client;
|
||||
using Service.Charger.Msg.Charger.Req;
|
||||
using Service.Charger.Msg.Charger.Resp;
|
||||
|
||||
|
||||
namespace Service.Charger.Handler;
|
||||
|
||||
/// <summary>
|
||||
/// 红绿灯命令回复 处理器
|
||||
/// </summary>
|
||||
[Order(8)]
|
||||
[Scope("InstancePerDependency")]
|
||||
public class TrafficLightResqHandler : SimpleChannelInboundHandler<TrafficLightResq>, IBaseHandler
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
private static readonly ILog Log = LogManager.GetLogger(typeof(TrafficLightResqHandler));
|
||||
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
protected override void ChannelRead0(IChannelHandlerContext ctx, TrafficLightResq msg)
|
||||
{
|
||||
Log.Info("TrafficLightResq Order Reply");
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using HybirdFrameworkCore.Autofac.Attribute;
|
||||
|
||||
namespace Service.Charger.Msg.Host.Req;
|
||||
|
||||
/// <summary>
|
||||
/// 红绿灯命令
|
||||
/// </summary>
|
||||
public class TrafficLightReq: ASDU {
|
||||
|
||||
/// <summary>
|
||||
/// 红绿灯 0x00-红灯, 0x01-绿灯
|
||||
/// </summary>
|
||||
[Property(0, 8 )]
|
||||
public byte TrafficLight { get;set;}
|
||||
|
||||
public TrafficLightReq(byte trafficLight)
|
||||
{
|
||||
FrameTypeNo = 118;
|
||||
MsgBodyCount = 1;
|
||||
TransReason = 3;
|
||||
PublicAddr = 0;
|
||||
MsgBodyAddr = new byte[] { 0, 0, 0 };
|
||||
TrafficLight = trafficLight;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using HybirdFrameworkCore.Autofac.Attribute;
|
||||
|
||||
namespace Service.Charger.Msg.Charger.Resp;
|
||||
|
||||
/// <summary>
|
||||
/// 红绿灯命令回复
|
||||
/// </summary>
|
||||
public class TrafficLightResq : ASDU
|
||||
{
|
||||
/// <summary>
|
||||
/// 应答结果
|
||||
/// </summary>
|
||||
[Property(0, 8 )]
|
||||
public byte AnswerResult {get;set;}
|
||||
|
||||
}
|
Loading…
Reference in new issue