flush

Flush serial port buffers

Description

example

flush(device) flushes all data from both the input and output buffers of the specified serial port.

flush(device,"input") flushes only the input buffer of the specified serial port.

flush(device,"output") flushes only the output buffer of the specified serial port.

Examples

collapse all

Use the default to flush both serial port buffers.

s = serialport("COM3",9600);
 ⋮
flush(s);

Input Arguments

collapse all

Serial port, specified as a serialport object.

Example: serialport()

See Also

Functions

Introduced in R2019b