PipeSerialPort 类 |
命名空间: HslCommunication.Core.Pipe
PipeSerialPort 类型公开以下成员。
名称 | 说明 | |
---|---|---|
PipeSerialPort |
实例化一个默认的对象 Instantiate a default object | |
PipeSerialPort(String) |
实例化一个默认的对象 Instantiate a default object |
名称 | 说明 | |
---|---|---|
AtLeastReceiveLength |
从串口中至少接收的字节长度信息,默认为1个字节
| |
CommunicationLock |
获取或设置当前管道的线程锁对象,默认是简单的一个互斥锁 (继承自 CommunicationPipe。)Gets or sets the thread lock object of the current pipeline, which defaults to a simple mutex | |
DecideWhetherQAMessageFunction |
用来决定当前接收的消息是否是问答服务的消息
(继承自 CommunicationPipe。) | |
DtrEnable |
获取或设置一个值,该值指示在串行通信中是否启用数据终端就绪 (Drt) 信号。 Gets or sets a value that indicates whether the Data Terminal Ready (DRT) signal is enabled in serial communication. | |
IsClearCacheBeforeRead |
是否在发送数据前清空缓冲数据,默认是false Whether to empty the buffer before sending data, the default is false | |
IsPersistentConnection |
获取或设置当前的管道是否是长连接,仅对于串口及TCP是有效的,默认都是长连接
(继承自 CommunicationPipe。) | |
ReceiveEmptyDataCount | ||
ReceiveTimeOut |
获取或设置接收服务器反馈的时间,如果为负数,则不接收反馈 (继承自 CommunicationPipe。)Gets or sets the time to receive server feedback, and if it is a negative number, does not receive feedback | |
RtsEnable |
获取或设置一个值,该值指示在串行通信中是否启用请求发送 (RTS) 信号。 Gets or sets a value indicating whether the request sending (RTS) signal is enabled in serial communication. | |
SleepTime |
获取或设置在正式接收对方返回数据前的时候,需要休息的时间,当设置为0的时候,不需要休息。 (继承自 CommunicationPipe。)Get or set the time required to rest before officially receiving the data from the other party. When it is set to 0, no rest is required. | |
UseServerActivePush |
获取或设置当前的管道是否激活从设备主动推送的功能,设置为 true 时支持主动从设备方接收数据信息 (继承自 CommunicationPipe。)Gets or sets whether the current pipeline activates the function of actively pushing data from the device. If this is set to true, it supports actively receiving data information from the device |
名称 | 说明 | |
---|---|---|
CheckMessageComplete |
根据给定的消息,发送的数据,接收到数据来判断是否接收完成报文
(继承自 CommunicationPipe。) | |
ClearSerialCache |
清除串口缓冲区的数据,并返回该数据,如果缓冲区没有数据,返回的字节数组长度为0 The number sent clears the data in the serial port buffer and returns that data, or if there is no data in the buffer, the length of the byte array returned is 0 | |
CloseCommunication |
关闭当前的管道信息,返回是否关闭成功的结果对象
(重写 CommunicationPipeCloseCommunication.) | |
CloseCommunicationAsync | (继承自 CommunicationPipe。) | |
Dispose | Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. (继承自 CommunicationPipe。) | |
Dispose(Boolean) | Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. (重写 CommunicationPipeDispose(Boolean).) | |
Equals | Determines whether the specified object is equal to the current object. (继承自 Object。) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (继承自 Object。) | |
GetHashCode | Serves as the default hash function. (继承自 Object。) | |
GetPipe |
获取当前的串口对象信息 Get current serial port object information | |
GetType | Gets the Type of the current instance. (继承自 Object。) | |
IncrConnectErrorCount |
自增当前的连续错误计数,并且获取自增后的值信息,最大到10亿为止,无法继续增加了。
(继承自 CommunicationPipe。) | |
IsConnectError |
当前的管道连接对象是否发生了错误
(继承自 CommunicationPipe。) | |
IsOpen |
获取一个值,指示串口是否处于打开状态 Gets a value indicating whether the serial port is open | |
MemberwiseClone | Creates a shallow copy of the current Object. (继承自 Object。) | |
OpenCommunication |
打开当前的管道信息,返回是否成功打开的结果对象,并通过属性 Content 指示当前是否为新创建的连接对象,如果是,则该值为 true (重写 CommunicationPipeOpenCommunication.) | |
OpenCommunicationAsync |
打开当前的管道信息,返回是否成功打开的结果对象,并通过属性 Content 指示当前是否为新创建的连接对象,如果是,则该值为 true (继承自 CommunicationPipe。) | |
RaisePipeError |
主动引发一个管道错误,从而让管道可以重新打开
(继承自 CommunicationPipe。) | |
ReadFromCoreServer |
将数据发送到当前的管道里,并从管道接收相关的数据信息,可以指定消息类型,发送数据,是否有数据响应,休眠时间 (重写 CommunicationPipeReadFromCoreServer(INetMessage, Byte, Boolean, ActionByte).)To send data to the current pipeline and receive relevant data information from the pipeline, you can specify the message type, the data sent, whether there is a data response, and the sleep time | |
ReadFromCoreServerAsync |
将数据发送到当前的管道里,并从管道接收相关的数据信息,可以指定消息类型,发送数据,是否有数据响应,休眠时间 (重写 CommunicationPipeReadFromCoreServerAsync(INetMessage, Byte, Boolean, ActionByte).)To send data to the current pipeline and receive relevant data information from the pipeline, you can specify the message type, the data sent, whether there is a data response, and the sleep time | |
ReadFromCoreServerHelper |
将数据发送到当前的管道里,并从管道接收相关的数据信息,可以指定消息类型,发送数据,是否有数据响应,休眠时间 (继承自 CommunicationPipe。)To send data to the current pipeline and receive relevant data information from the pipeline, you can specify the message type, the data sent, whether there is a data response, and the sleep time | |
ReadFromCoreServerHelperAsync |
将数据发送到当前的管道里,并从管道接收相关的数据信息,可以指定消息类型,发送数据,是否有数据响应,休眠时间 (继承自 CommunicationPipe。)To send data to the current pipeline and receive relevant data information from the pipeline, you can specify the message type, the data sent, whether there is a data response, and the sleep time | |
Receive(Int32, Int32, ActionInt64, Int64) |
从管道里,接收指定长度的报文数据信息,如果长度指定为-1,表示接收不超过2048字节的动态长度。另外可以指定超时时间,进度报告等 (继承自 CommunicationPipe。)Receives the packet data of a specified length from the pipe. If the length is set to -1, it indicates that the dynamic length of the packet is not more than 2048 bytes. You can also specify timeouts, progress reports, etc | |
Receive(Byte, Int32, Int32, Int32, ActionInt64, Int64) |
接收固定长度的字节数组,允许指定超时时间,默认为60秒,当length大于0时,接收固定长度的数据内容,当length小于0时,buffer长度的缓存数据 (重写 CommunicationPipeReceive(Byte, Int32, Int32, Int32, ActionInt64, Int64).)Receiving a fixed-length byte array, allowing a specified timeout time. The default is 60 seconds. When length is greater than 0, fixed-length data content is received. When length is less than 0, random data information of a length not greater than 2048 is received. | |
ReceiveAsync(Int32, Int32, ActionInt64, Int64) |
从管道里,接收指定长度的报文数据信息,如果长度指定为-1,表示接收不超过2048字节的动态长度。另外可以指定超时时间,进度报告等 (继承自 CommunicationPipe。)Receives the packet data of a specified length from the pipe. If the length is set to -1, it indicates that the dynamic length of the packet is not more than 2048 bytes. You can also specify timeouts, progress reports, etc | |
ReceiveAsync(Byte, Int32, Int32, Int32, ActionInt64, Int64) |
接收固定长度的字节数组,允许指定超时时间,默认为60秒,当length大于0时,接收固定长度的数据内容,当length小于0时,buffer长度的缓存数据 (继承自 CommunicationPipe。)Receiving a fixed-length byte array, allowing a specified timeout time. The default is 60 seconds. When length is greater than 0, fixed-length data content is received. When length is less than 0, random data information of a length not greater than 2048 is received. | |
ReceiveMessage |
包含了一个复杂的逻辑,从管道里根据当前的消息格式定义,接收报文信息,这个报文可能是来自服务器主动推送的。具体可以通过参数 useActivePush 来特殊控制。 (重写 CommunicationPipeReceiveMessage(INetMessage, Byte, Boolean, ActionInt64, Int64, ActionByte).)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. | |
ReceiveMessageAsync |
包含了一个复杂的逻辑,从管道里根据当前的消息格式定义,接收报文信息,这个报文可能是来自服务器主动推送的。具体可以通过参数 useActivePush 来特殊控制。 (重写 CommunicationPipeReceiveMessageAsync(INetMessage, Byte, Boolean, ActionInt64, Int64, ActionByte).)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. | |
ResetConnectErrorCount |
重置当前的连续错误计数为0,并且返回重置前时候的值
(继承自 CommunicationPipe。) | |
Send(Byte) |
发送数据到当前的管道中去 (继承自 CommunicationPipe。)Send data to the current pipe | |
Send(Byte, Int32, Int32) |
将一个数据缓存中的指定的部分字段,发送到当前的管道中去 (重写 CommunicationPipeSend(Byte, Int32, Int32).)Sends the specified partial field from a data cache to the current pipeline | |
SendAsync(Byte) |
发送数据到当前的管道中去 (继承自 CommunicationPipe。)Send data to the current pipe | |
SendAsync(Byte, Int32, Int32) |
将一个数据缓存中的指定的部分字段,发送到当前的管道中去 (继承自 CommunicationPipe。)Sends the specified partial field from a data cache to the current pipeline | |
SerialPortInni(ActionSerialPort) |
根据自定义初始化方法进行初始化串口信息 Initialize the serial port information according to the custom initialization method | |
SerialPortInni(String) |
初始化串口信息,9600波特率,8位数据位,1位停止位,无奇偶校验 Initial serial port information, 9600 baud rate, 8 data bits, 1 stop bit, no parity | |
SerialPortInni(String, Int32, Int32, StopBits, Parity) |
初始化串口信息,波特率,数据位,停止位,奇偶校验需要全部自己来指定 Start serial port information, baud rate, data bit, stop bit, parity all need to be specified | |
SetBufferQA |
设置当前的问答状态下的缓存数据
(继承自 CommunicationPipe。) | |
StartReceiveBackground |
开始后台接收相关的报文数据,当UseServerActivePush为True时,则使用本方法
(继承自 CommunicationPipe。) | |
ToString | Returns a string that represents the current object. (重写 ObjectToString.) |
名称 | 说明 | |
---|---|---|
autoResetEvent |
当启用设备方主动发送数据时,用于同步访问方法的信号同步功能
(继承自 CommunicationPipe。) | |
bufferQA |
当启用设备方主动发送数据时,用于应答服务机制的数据缓存
(继承自 CommunicationPipe。) | |
isPersistentConn |
是否是长连接的状态 (继承自 CommunicationPipe。)Whether it is a long connection state |
名称 | 说明 | |
---|---|---|
ToJsonString |
获取当前对象的JSON格式表示的字符串。 (由 HslExtension 定义。)Gets the string represented by the JSON format of the current object. |