Main Content

本页的翻译已过时。点击此处可查看最新英文版本。

Bluetooth 通信

读取和写入 Bluetooth® 设备

Bluetooth 是用于使用短波长无线电传输进行短距离数据交换的无线通信协议。具有 Bluetooth 功能的常见设备包括笔记本电脑、手机和无线传感器。

使用 MATLAB® 中的 Bluetooth 接口传送和接收 ASCII 和二进制数据。此接口使用 Bluetooth 串行端口配置文件 (SPP)。您可以从 MATLAB 识别任何 Bluetooth SPP 设备并与该设备建立双向连接。

要与 Bluetooth 设备通信,您的计算机需要具有内置或外置的 Bluetooth 适配器。有关详细信息,请参阅Configure Bluetooth Communication Settings

函数

全部展开

bluetoothlist扫描附近的 Bluetooth 经典设备
bluetooth连接到 Bluetooth 经典设备
configureTerminator为与 Bluetooth 设备的 ASCII 字符串通信设置终止符
configureCallback为与 Bluetooth 设备的通信设置回调函数和触发条件
readBluetooth 设备读取数据
readlineBluetooth 设备读取 ASCII 字符串数据行
write将数据写入 Bluetooth 设备
writeline将 ASCII 数据行写入 Bluetooth 设备
flush清空 Bluetooth 设备缓冲区

主题

Bluetooth Communication Overview

Learn about the basic concepts of Bluetooth communication.

Configure Bluetooth Communication Settings

Establish a connection between MATLAB and your Bluetooth device.

Transmit Data Using Bluetooth Communication

Write and read both text and binary data with a Bluetooth device.

Use Callbacks for Bluetooth Communication

Enhance instrument communication by executing a callback function when a specified event occurs on the device.

Transition Your Code to bluetooth Interface

Connect to Bluetooth devices using bluetooth instead of Bluetooth.

疑难解答

Troubleshooting Bluetooth Communication

Troubleshoot the Bluetooth interface.

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.

特色示例