diff --git a/protocols/JiShe.CollectBus.Protocol.T37612012/T37612012ProtocolPlugin.cs b/protocols/JiShe.CollectBus.Protocol.T37612012/T37612012ProtocolPlugin.cs index 5b82aa6..25ed0fb 100644 --- a/protocols/JiShe.CollectBus.Protocol.T37612012/T37612012ProtocolPlugin.cs +++ b/protocols/JiShe.CollectBus.Protocol.T37612012/T37612012ProtocolPlugin.cs @@ -31,7 +31,7 @@ namespace JiShe.CollectBus.Protocol.T37612012 private readonly ITcpService _tcpService; public readonly Dictionary T3761AFNHandlers; - + /// /// Initializes a new instance of the class. /// @@ -46,7 +46,7 @@ namespace JiShe.CollectBus.Protocol.T37612012 T3761AFNHandlers = Telemetry3761PacketBuilder.T3761AFNHandlers; } - public override ProtocolInfo Info => new(nameof(T37612012ProtocolPlugin), "376.1", "TCP", "376.1协议", "DTS1980"); + public override ProtocolInfo Info => new(nameof(T37612012ProtocolPlugin), "376.1", "TCP", "376.1协议", "DTS1980"); public override async Task AnalyzeAsync(ITcpSessionClient client, string messageReceived, Action? sendAction = null) { @@ -106,7 +106,7 @@ namespace JiShe.CollectBus.Protocol.T37612012 // MessageId = NewId.NextGuid().ToString() //}); - if (tB3761.AFN_FC.BaseHexMessage == null || tB3761.DT.BaseHexMessage == null || tB3761.BaseHexMessage.HexMessageString==null) + if (tB3761.AFN_FC.BaseHexMessage == null || tB3761.DT.BaseHexMessage == null || tB3761.BaseHexMessage.HexMessageString == null) { _logger.LogError("376.1协议解析AFN失败"); return; @@ -180,7 +180,7 @@ namespace JiShe.CollectBus.Protocol.T37612012 MessageHexString = messageReceived, DeviceNo = code, MessageId = Guid.NewGuid().ToString(), - ReceivedTime=DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + ReceivedTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") }; await _producerService.ProduceAsync(ProtocolConst.SubscriberLoginReceivedEventName, messageReceivedLoginEvent); var reqParam = new ReqParameter2 @@ -269,7 +269,7 @@ namespace JiShe.CollectBus.Protocol.T37612012 ReceivedTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") }; await _producerService.ProduceAsync(ProtocolConst.SubscriberHeartbeatReceivedEventName, messageReceivedHeartbeatEvent); - + var reqParam = new ReqParameter2() { AFN = AFN.确认或否认, @@ -288,7 +288,7 @@ namespace JiShe.CollectBus.Protocol.T37612012 Fn = 1 }; var bytes = Build3761SendData.BuildSendCommandBytes(reqParam); - + IssuedEventMessage issuedEventMessage = new IssuedEventMessage { ClientId = messageReceivedHeartbeatEvent.ClientId, @@ -304,9 +304,9 @@ namespace JiShe.CollectBus.Protocol.T37612012 await _producerService.ProduceAsync(ProtocolConst.SubscriberHeartbeatIssuedEventName, issuedEventMessage); } - + } - + /// /// 组装报文 /// @@ -536,7 +536,7 @@ namespace JiShe.CollectBus.Protocol.T37612012 AFN_FC aFN_FC = new AFN_FC(); try { - if (hexStringList.Count == 0) + if (hexStringList.Count > 0) { BaseHexMessage baseHexMessage = new BaseHexMessage @@ -833,7 +833,7 @@ namespace JiShe.CollectBus.Protocol.T37612012 var a = $"{a1}{a2Dec.ToString().PadLeft(5, '0')}"; return a; } - + #endregion } }