bluetoothlist
Description
Examples
Scan Nearby Bluetooth Classic Devices
Scan nearby Bluetooth Classic devices and check their connection status.
Use bluetoothlist
to list all nearby devices. If your device is
already connected to another device or application, it might not appear in this list.
Disconnect your device from any other devices or applications first for MATLAB® to
discover it.
devlist = bluetoothlist
devlist=5×4 table
Name Address Channel Status
_____________ ______________ _______ __________________
"Pixel 3" "3C286DD533CA" 8 "Ready to connect"
"HC-06" "98D331FB3B77" 1 "Requires pairing"
"mjin-maci" "A886DDA44062" 3 "Requires pairing"
"DMTDevice" "B0B448F47A4C" Unknown "Unknown"
The Name
and Address
columns identify the
device. The Channel
column indicates the device SPP channel. The
Status
column describes the current device connection
status.
You can also specify a timeout value less than the default 35 seconds on Windows and 20 seconds on macOS.
devlist = bluetoothlist("Timeout",10)
devlist=3×4 table
Name Address Channel Status
_____________ ______________ _______ __________________
"Pixel 3" "3C286DD533CA" 8 "Ready to connect"
"mjin-maci" "A886DDA44062" 3 "Requires pairing"
Output Arguments
devlist
— List of nearby Bluetooth devices
table
List of nearby Bluetooth devices, returned as a table. The table has the following columns.
Name
— Device name
string scalar
Device name, returned as a string scalar. Multiple devices can share the same name.
Data Types: string
Address
— Device identifier
string scalar
Device identifier, returned as a string scalar.
Data Types: string
Channel
— Device channel
categorical scalar
Device SPP channel, returned as a categorical scalar. If the channel is
unknown, the value in this column is Unknown
.
Data Types: categorical
Status
— Device connection status
"Ready to connect"
| "Requires pairing"
| "Connected"
| "Unsupported"
| "Unknown"
Device connection status, returned as a string. You can connect to a
Bluetooth device using bluetooth
only if
its status is "Ready to connect"
. Possible values
follow.
Value | Description |
---|---|
"Ready to connect" | Device supports SPP, is paired, and not connected anywhere. |
"Requires pairing" | Device supports SPP and is not paired. |
"Connected" | Device supports SPP and is connected. |
"Unsupported" | Device does not support SPP. |
"Unknown" | Unknown if device supports SPP. Device is turned off or fails to respond to scanning request. |
Data Types: string
Version History
Introduced in R2020b
See Also
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)