FreedomTcpNetCheckResponseStatus 属性 |
一个对返回数据合法检查的委托实例,默认为空,不进行合法性检查,可以实例化实现任意的报文检测,返回是否合法结果。
A delegate instance that checks the legality of the returned data. It is empty by default and does not perform legality checking.
It can be instantiated to implement any packet inspection and return whether the result is legal or not.
命名空间:
HslCommunication.Profinet.Freedom
程序集:
HslCommunication (在 HslCommunication.dll 中) 版本:12.1.2.0 (12.1.2.0)
语法 public Func<byte[], byte[], OperateResult> CheckResponseStatus { get; set; }
Public Property CheckResponseStatus As Func(Of Byte(), Byte(), OperateResult)
Get
Set
public:
property Func<array<unsigned char>^, array<unsigned char>^, OperateResult^>^ CheckResponseStatus {
Func<array<unsigned char>^, array<unsigned char>^, OperateResult^>^ get ();
void set (Func<array<unsigned char>^, array<unsigned char>^, OperateResult^>^ value);
}
member CheckResponseStatus : Func<byte[], byte[], OperateResult> with get, set
属性值
类型:
FuncByte,
Byte,
OperateResult备注
例如返回的第一个字节为0表示正常报文,否则是异常返回,可以简写:CheckResponseStatus = ( send, receive ) => receive[2] == 0 ? OperateResult.CreateSuccessResult( ) : new OperateResult( receive[2], "error" );
For example, if the first byte returned is 0, it means a normal message, otherwise it is an abnormal return,
which can be abbreviated as: CheckResponseStatus = ( send, receive ) => receive[2] == 0 ? OperateResult.CreateSuccessResult( ) : new OperateResult( receive[2], "error" );
参见