PipeSerialPortReceiveMessage 方法 |
包含了一个复杂的逻辑,从管道里根据当前的消息格式定义,接收报文信息,这个报文可能是来自服务器主动推送的。具体可以通过参数 useActivePush 来特殊控制。
Contains a complex logic from the pipeline, according to the current message format definition, to receive message information,
this message may be actively pushed from the server. The parameter useActivePush can be used for special control.
命名空间:
HslCommunication.Core.Pipe
程序集:
HslCommunication (在 HslCommunication.dll 中) 版本:12.1.2.0 (12.1.2.0)
语法 public override OperateResult<byte[]> ReceiveMessage(
INetMessage netMessage,
byte[] sendValue,
bool useActivePush = true,
Action<long, long> reportProgress = null,
Action<byte[]> logMessage = null
)
Public Overrides Function ReceiveMessage (
netMessage As INetMessage,
sendValue As Byte(),
Optional useActivePush As Boolean = true,
Optional reportProgress As Action(Of Long, Long) = Nothing,
Optional logMessage As Action(Of Byte()) = Nothing
) As OperateResult(Of Byte())
public:
virtual OperateResult<array<unsigned char>^>^ ReceiveMessage(
INetMessage^ netMessage,
array<unsigned char>^ sendValue,
bool useActivePush = true,
Action<long long, long long>^ reportProgress = nullptr,
Action<array<unsigned char>^>^ logMessage = nullptr
) override
abstract ReceiveMessage :
netMessage : INetMessage *
sendValue : byte[] *
?useActivePush : bool *
?reportProgress : Action<int64, int64> *
?logMessage : Action<byte[]>
(* Defaults:
let _useActivePush = defaultArg useActivePush true
let _reportProgress = defaultArg reportProgress null
let _logMessage = defaultArg logMessage null
*)
-> OperateResult<byte[]>
override ReceiveMessage :
netMessage : INetMessage *
sendValue : byte[] *
?useActivePush : bool *
?reportProgress : Action<int64, int64> *
?logMessage : Action<byte[]>
(* Defaults:
let _useActivePush = defaultArg useActivePush true
let _reportProgress = defaultArg reportProgress null
let _logMessage = defaultArg logMessage null
*)
-> OperateResult<byte[]>
参数
- netMessage
- 类型:HslCommunication.Core.IMessageINetMessage
消息对象 - sendValue
- 类型:SystemByte
发送的数据,大多数的情况,都可以为空 - useActivePush (Optional)
- 类型:SystemBoolean
是否使用服务方主动推送的数据,默认为 true - reportProgress (Optional)
- 类型:SystemActionInt64, Int64
进行进度报告的委托 - logMessage (Optional)
- 类型:SystemActionByte
用于消息记录的日志信息
返回值
类型:
OperateResultByte是否
参见