添加发送报文日志

This commit is contained in:
高国正 2023-02-27 11:20:12 +08:00
parent a21ee9d304
commit d0a2b6a9f2
10 changed files with 15 additions and 13 deletions

Binary file not shown.

View File

@ -142,12 +142,14 @@ namespace NengLiang
byte code = 0x03; byte code = 0x03;
ushort start = (ushort)0; ushort start = (ushort)0;
ushort length = ushort.Parse("0033"); ushort length = ushort.Parse("0033");
//byte[] bytes;// 发送字节 byte[] bytes;// 发送字节
foreach (var v in OnLineDic.Values) foreach (var v in OnLineDic.Values)
{ {
Thread.Sleep(T); Thread.Sleep(T);
ReadKsepRsgistecs(devAdd, code, start, length); bytes = ReadKsepRsgistecs(devAdd, code, start, length);
log.Info("发送至" + v.RemoteEndPoint + ": " + ToolKit.byteArrayToHexString(bytes));
v.Send(bytes);
//foreach (var item in RegisterType.Keys) //foreach (var item in RegisterType.Keys)
//{ //{
// if (T >= 0) { Thread.Sleep(T); } // if (T >= 0) { Thread.Sleep(T); }
@ -316,7 +318,7 @@ namespace NengLiang
else else
{ {
//执行解析 //执行解析
log.Info("接收" + clientSocket.RemoteEndPoint + ": " + _message); log.Info("接收" + clientSocket.RemoteEndPoint + ": " + _message);
JudgmentFunction(bytes); JudgmentFunction(bytes);
} }
} }