Hauptinhalt

Bluetooth-Kommunikation

Lesen aus und Schreiben in Bluetooth®-Geräte

Bluetooth ist ein drahtloses Kommunikationsprotokoll zum Datenaustausch über kurze Entfernungen unter Einsatz von Funkübertragungen mit kurzer Wellenlänge. Gängige Geräte mit Bluetooth-Funktionen sind Laptops, Smartphones und drahtlose Sensoren.

Über die Bluetooth-Schnittstelle in MATLAB® können Sie ASCII- und Binärdaten übertragen und empfangen. Diese Schnittstelle nutzt das Bluetooth Serial Port Profile (SPP). Sie können jedes beliebige Bluetooth-SPP-Gerät identifizieren und eine Zwei-Wege-Verbindung mit diesem Gerät über MATLAB aufbauen.

Für die Kommunikation mit einem Bluetooth-Gerät benötigt Ihre Computer einen eingebauten oder externen Bluetooth-Adapter. Weitere Informationen finden Sie unter Configure Bluetooth Communication Settings.

Für die Simulation, Analyse und Prüfung der Bluetooth-Kommunikationssysteme siehe Bluetooth Toolbox.

Funktionen

alle erweitern

bluetoothlistScan nearby Bluetooth Classic devices
bluetoothConnect to Bluetooth Classic device
configureTerminatorSet terminator for ASCII string communication with Bluetooth device
configureCallbackSet callback function and trigger condition for communication with Bluetooth device
readRead data from Bluetooth device
readlineRead line of ASCII string data from Bluetooth device
writeWrite data to Bluetooth device
writelineWrite line of ASCII data to Bluetooth device
flushClear Bluetooth device buffers

Themen

Fehlersuche

Troubleshooting Bluetooth Communication

Troubleshoot the Bluetooth interface.

Resolve Bluetooth Connection Errors

Troubleshoot connecting to a Bluetooth device.

Resolve Bluetooth Warning: Unable to Read Any Data

Troubleshoot when you receive no data and you get the warning message: Bluetooth unable to read any data.

Resolve Bluetooth Warning: Unable to Read All Data

Troubleshoot when you receive some data and you get the warning message: Bluetooth unable to read all requested data.

Enthaltene Beispiele