Compare commits
2 Commits
8f64c3aa5b
...
13f055a3e5
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
13f055a3e5 | ||
|
|
e7ff709a68 |
@ -31,7 +31,7 @@ namespace JiShe.CollectBus.Protocol.T37612012
|
|||||||
private readonly ITcpService _tcpService;
|
private readonly ITcpService _tcpService;
|
||||||
|
|
||||||
public readonly Dictionary<string, Telemetry3761PacketBuilder.T3761Delegate> T3761AFNHandlers;
|
public readonly Dictionary<string, Telemetry3761PacketBuilder.T3761Delegate> T3761AFNHandlers;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="T37612012ProtocolPlugin"/> class.
|
/// Initializes a new instance of the <see cref="T37612012ProtocolPlugin"/> class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -46,7 +46,7 @@ namespace JiShe.CollectBus.Protocol.T37612012
|
|||||||
T3761AFNHandlers = Telemetry3761PacketBuilder.T3761AFNHandlers;
|
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<T> AnalyzeAsync<T>(ITcpSessionClient client, string messageReceived, Action<T>? sendAction = null)
|
public override async Task<T> AnalyzeAsync<T>(ITcpSessionClient client, string messageReceived, Action<T>? sendAction = null)
|
||||||
{
|
{
|
||||||
@ -106,7 +106,7 @@ namespace JiShe.CollectBus.Protocol.T37612012
|
|||||||
// MessageId = NewId.NextGuid().ToString()
|
// 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失败");
|
_logger.LogError("376.1协议解析AFN失败");
|
||||||
return;
|
return;
|
||||||
@ -180,7 +180,7 @@ namespace JiShe.CollectBus.Protocol.T37612012
|
|||||||
MessageHexString = messageReceived,
|
MessageHexString = messageReceived,
|
||||||
DeviceNo = code,
|
DeviceNo = code,
|
||||||
MessageId = Guid.NewGuid().ToString(),
|
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);
|
await _producerService.ProduceAsync(ProtocolConst.SubscriberLoginReceivedEventName, messageReceivedLoginEvent);
|
||||||
var reqParam = new ReqParameter2
|
var reqParam = new ReqParameter2
|
||||||
@ -269,7 +269,7 @@ namespace JiShe.CollectBus.Protocol.T37612012
|
|||||||
ReceivedTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")
|
ReceivedTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")
|
||||||
};
|
};
|
||||||
await _producerService.ProduceAsync(ProtocolConst.SubscriberHeartbeatReceivedEventName, messageReceivedHeartbeatEvent);
|
await _producerService.ProduceAsync(ProtocolConst.SubscriberHeartbeatReceivedEventName, messageReceivedHeartbeatEvent);
|
||||||
|
|
||||||
var reqParam = new ReqParameter2()
|
var reqParam = new ReqParameter2()
|
||||||
{
|
{
|
||||||
AFN = AFN.确认或否认,
|
AFN = AFN.确认或否认,
|
||||||
@ -288,7 +288,7 @@ namespace JiShe.CollectBus.Protocol.T37612012
|
|||||||
Fn = 1
|
Fn = 1
|
||||||
};
|
};
|
||||||
var bytes = Build3761SendData.BuildSendCommandBytes(reqParam);
|
var bytes = Build3761SendData.BuildSendCommandBytes(reqParam);
|
||||||
|
|
||||||
IssuedEventMessage issuedEventMessage = new IssuedEventMessage
|
IssuedEventMessage issuedEventMessage = new IssuedEventMessage
|
||||||
{
|
{
|
||||||
ClientId = messageReceivedHeartbeatEvent.ClientId,
|
ClientId = messageReceivedHeartbeatEvent.ClientId,
|
||||||
@ -304,9 +304,9 @@ namespace JiShe.CollectBus.Protocol.T37612012
|
|||||||
await _producerService.ProduceAsync(ProtocolConst.SubscriberHeartbeatIssuedEventName, issuedEventMessage);
|
await _producerService.ProduceAsync(ProtocolConst.SubscriberHeartbeatIssuedEventName, issuedEventMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 组装报文
|
/// 组装报文
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -536,7 +536,7 @@ namespace JiShe.CollectBus.Protocol.T37612012
|
|||||||
AFN_FC aFN_FC = new AFN_FC();
|
AFN_FC aFN_FC = new AFN_FC();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (hexStringList.Count == 0)
|
if (hexStringList.Count > 0)
|
||||||
{
|
{
|
||||||
|
|
||||||
BaseHexMessage baseHexMessage = new BaseHexMessage
|
BaseHexMessage baseHexMessage = new BaseHexMessage
|
||||||
@ -833,7 +833,7 @@ namespace JiShe.CollectBus.Protocol.T37612012
|
|||||||
var a = $"{a1}{a2Dec.ToString().PadLeft(5, '0')}";
|
var a = $"{a1}{a2Dec.ToString().PadLeft(5, '0')}";
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user