Change TParamOut to class
This commit is contained in:
@@ -38,7 +38,7 @@ namespace Modbus.Net
|
|||||||
/// 基本协议
|
/// 基本协议
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public abstract class BaseProtocal<TParamIn, TParamOut, TProtocalUnit> :
|
public abstract class BaseProtocal<TParamIn, TParamOut, TProtocalUnit> :
|
||||||
IProtocal<TParamIn, TParamOut, TProtocalUnit> where TProtocalUnit : ProtocalUnit<TParamIn, TParamOut>
|
IProtocal<TParamIn, TParamOut, TProtocalUnit> where TProtocalUnit : ProtocalUnit<TParamIn, TParamOut> where TParamOut : class
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 构造器
|
/// 构造器
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ namespace Modbus.Net
|
|||||||
/// 基础Api入口
|
/// 基础Api入口
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public abstract class BaseUtility<TParamIn, TParamOut, TProtocalUnit> : IUtilityProperty, IUtilityMethodData
|
public abstract class BaseUtility<TParamIn, TParamOut, TProtocalUnit> : IUtilityProperty, IUtilityMethodData
|
||||||
where TProtocalUnit : ProtocalUnit<TParamIn, TParamOut>
|
where TProtocalUnit : ProtocalUnit<TParamIn, TParamOut> where TParamOut : class
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 协议收发主体
|
/// 协议收发主体
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ namespace Modbus.Net
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 基本的协议连接器
|
/// 基本的协议连接器
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public abstract class ProtocalLinker<TParamIn, TParamOut> : IProtocalLinker<TParamIn, TParamOut>
|
public abstract class ProtocalLinker<TParamIn, TParamOut> : IProtocalLinker<TParamIn, TParamOut> where TParamOut : class
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 传输连接器
|
/// 传输连接器
|
||||||
@@ -106,8 +106,7 @@ namespace Modbus.Net
|
|||||||
{
|
{
|
||||||
var extBytes = BytesExtend(content);
|
var extBytes = BytesExtend(content);
|
||||||
var receiveBytes = await SendReceiveWithoutExtAndDecAsync(extBytes);
|
var receiveBytes = await SendReceiveWithoutExtAndDecAsync(extBytes);
|
||||||
if (receiveBytes != null) return receiveBytes;
|
return receiveBytes;
|
||||||
throw new NullReferenceException();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -132,8 +131,7 @@ namespace Modbus.Net
|
|||||||
//容错处理
|
//容错处理
|
||||||
var checkRight = CheckRight(receiveBytes);
|
var checkRight = CheckRight(receiveBytes);
|
||||||
//返回字符
|
//返回字符
|
||||||
if (checkRight == true) return receiveBytes;
|
return checkRight == true ? receiveBytes : null;
|
||||||
throw new NullReferenceException();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user