clear_serialT_clear_serialClearSerialClearSerialclear_serial (算子)
名称
clear_serialT_clear_serialClearSerialClearSerialclear_serial — 清除串行连接的缓冲区。
签名
描述
clear_serialclear_serialClearSerialClearSerialClearSerialclear_serial discards data written to the serial device
referred to by SerialHandleSerialHandleSerialHandleSerialHandleserialHandleserial_handle, but not transmitted
(ChannelChannelChannelChannelchannelchannel = 'output'"output""output""output""output""output"), or data received, but not
read (ChannelChannelChannelChannelchannelchannel = 'input'"input""input""input""input""input"), or performs both these
operations at once (ChannelChannelChannelChannelchannelchannel = 'in_out'"in_out""in_out""in_out""in_out""in_out").
执行信息
- 多线程类型:可重入(与非独占算子并行运行)。
- 多线程作用域:全局(可从任何线程调用)。
- 未采用并行化处理。
此算子修改后续输入参数的状态:
在执行此算子时,若该参数值需在多个线程间使用,则必须对其访问进行同步。
参数
SerialHandleSerialHandleSerialHandleSerialHandleserialHandleserial_handle (输入控制,状态被修改) serial → HSerial, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)
Serial interface handle.
ChannelChannelChannelChannelchannelchannel (输入控制) string → HTuplestrHTupleHtuple (string) (string) (HString) (char*)
Buffer to be cleared.
默认值:
'input'
"input"
"input"
"input"
"input"
"input"
值列表:
'in_out'"in_out""in_out""in_out""in_out""in_out", 'input'"input""input""input""input""input", 'output'"output""output""output""output""output"
结果
If the parameters are correct and the buffers of the serial device
could be cleared, the operator clear_serialclear_serialClearSerialClearSerialClearSerialclear_serial 返回值 2 ( H_MSG_TRUE )。否则将抛出异常。
可能的前趋
open_serialopen_serialOpenSerialOpenSerialOpenSerialopen_serial
可能的后继
read_serialread_serialReadSerialReadSerialReadSerialread_serial,
write_serialwrite_serialWriteSerialWriteSerialWriteSerialwrite_serial
另见
read_serialread_serialReadSerialReadSerialReadSerialread_serial
模块
基础