serial.flush
serial.flush
功能
刷新已打开串口的输出缓冲。
语法
device.open(config).flush()
参数
无参数。
返回值
| 类型 | 说明 |
|---|---|
| Bool | 刷新成功返回 true。 |
示例
port = device.open({type: 'serial', port: 'COM3'}) result = port.flush() // 输出:true print result
注意事项
- 失败时抛出底层设备错误。
刷新已打开串口的输出缓冲。
device.open(config).flush()
无参数。
| 类型 | 说明 |
|---|---|
| Bool | 刷新成功返回 true。 |
port = device.open({type: 'serial', port: 'COM3'}) result = port.flush() // 输出:true print result