update adapter

This commit is contained in:
2248356998 qq.com
2023-05-22 12:42:31 +08:00
parent 60fa9c196c
commit ffa0e4e771
2 changed files with 3 additions and 2 deletions

View File

@@ -29,7 +29,7 @@ namespace ThingsGateway.Foundation.Adapter.Modbus
request.ResultCode = unpackbytes.ResultCode;
if (unpackbytes.IsSuccess)
{
request.ReceivedBytes = bytes;
request.ReceivedBytes = allBytes;
//解析01 03 00 00 00 0A
var station = ThingsGatewayBitConverter.ToByte(bytes, 6);
var function = ThingsGatewayBitConverter.ToByte(bytes, 7);

View File

@@ -76,6 +76,7 @@
{
if (request.BodyLength > byteBlock.CanReadLen)//body不满足解析开始缓存然后保存对象
{
request.ReceivedBytes = header;
return FilterResult.Cache;
}
if (request.BodyLength <= 0)
@@ -103,7 +104,7 @@
if (unpackbytes.IsSuccess)
{
request.Content = unpackbytes.Content;
request.ReceivedBytes = bytes;
request.ReceivedBytes = allBytes;
return FilterResult.Success;
}
else