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.

34 lines
1.2 KiB

using DotNetty.Transport.Channels;
using HybirdFrameworkCore.Autofac.Attribute;
using log4net;
using Service.Fire.Client;
using Service.Fire.Common;
using Service.Fire.Msg.Fire.Req;
namespace Service.Fire.Handler;
/// <summary>
/// 发送事件
/// <code>
/// 1保存日志到log
/// </code>
/// </summary>
[Order(8)]
[Scope("InstancePerDependency")]
public class DataNoAddresReqHandler : SimpleChannelInboundHandler<DataNoAddresReq>, IBaseHandler
{
private static readonly ILog Log = LogManager.GetLogger(typeof(DataNoAddresReqHandler));
protected override void ChannelRead0(IChannelHandlerContext ctx, DataNoAddresReq msg)
{
if (FireMgr.TryGetClient(ctx.Channel, out var sn, out var client))
{
Log.Info($"receive {msg} from {sn}");
string datatime = (new DateTime(2000 + msg.Years, msg.Month, msg.Day, msg.Hour, msg.Minute, msg.Seconds)).ToString();
string functionalAttribute = FireConst.FunctionalAttribute(msg.FunctionalAttribute);
string informationType = FireConst.InformationType(msg.InformationType);
string deviceStatus = FireConst.DeviceStatus(msg.DeviceStatus);
string deviceType = FireConst.DeviceType(msg.DeviceType);
}
}
}