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