devlist = bluetoothlist("Timeout",time) scans
for up to time seconds. The default timeout period is 35 seconds for
Windows® and 20 seconds for macOS. The value of time must be 5 or greater.
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.
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"
List of nearby Bluetooth devices, returned as a table. The table has the following columns.
Device name, returned as a string scalar. Multiple devices can share the same
name.
Data Types: string
Device identifier, returned as a string scalar.
Data Types: string
Device SPP channel, returned as a categorical scalar. If the channel is
unknown, the value in this column is Unknown.
Data Types: categorical
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.
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.
Sélectionner un site web
Choisissez un site web pour accéder au contenu traduit dans votre langue (lorsqu'il est disponible) et voir les événements et les offres locales. D’après votre position, nous vous recommandons de sélectionner la région suivante : .
Vous pouvez également sélectionner un site web dans la liste suivante :
Comment optimiser les performances du site
Pour optimiser les performances du site, sélectionnez la région Chine (en chinois ou en anglais). Les sites de MathWorks pour les autres pays ne sont pas optimisés pour les visites provenant de votre région.