测试下发更改发为字节

This commit is contained in:
zenghongyao 2025-05-08 11:58:26 +08:00
parent 245c91c9e3
commit 91386007ae
3 changed files with 4 additions and 2 deletions

View File

@ -257,7 +257,7 @@ namespace JiShe.CollectBus.Protocol.T37612012
else
decimal.TryParse(data[i], out value);
meter.DataValue = value;
meter.DataType = dataType;
meter.DataType = dataType.ToUpper();
meter.FiledDesc = filedDesc;
meter.FiledName = meter.DataType.GetDataFieldByGatherDataType() ?? string.Empty;
if (DateTime.TryParse(CalculateTimeSpan(i - 3, data[0], density), out DateTime readingDate))

View File

@ -25,6 +25,7 @@ using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Threading.Tasks;
using TouchSocket.Core;
using TouchSocket.Sockets;
namespace JiShe.CollectBus.Samples;
@ -434,7 +435,7 @@ public class SampleAppService : CollectBusAppService, ISampleAppService, IKafkaS
if (_tcpService.ClientExists(dto.Address))
{
// 发送给设备
await _tcpService.SendAsync(dto.Address, dto.Frame);
await _tcpService.SendAsync(dto.Address, Convert.FromHexString(dto.Frame));
_logger.LogWarning($"{dto.Address}下发消息报文:{dto.Frame}");
}
else

View File

@ -16,6 +16,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link href="libs/bootstrap/css/bootstrap.min.css" rel="stylesheet" />
<title>后端服务</title>
</head>
<body>