Clear Bluetooth device buffers
Flush Bluetooth Device Inputs and Outputs
Create a connection to a nearby Bluetooth device.
device = bluetooth("TestDevice")
device = bluetooth with properties: Name: "TestDevice" Address: "BC275C50533C" Channel: 1 NumBytesAvailable: 0 NumBytesWritten: 0 Show all properties
Write some data to the device and view the number of bytes available to be read in the input buffer.
ans = 5
Flush both the input and output buffers.
View the number of bytes available to be read.
ans = 0
The input buffer has no data.
device — Bluetooth device connection
Bluetooth device connection, specified as a
flush(device) flushes data from the Bluetooth connection
Introduced in R2020b