bluetooth
Bluetooth Classic デバイスへの接続
説明
bluetooth オブジェクトは、Bluetooth® シリアル ポート プロファイル (SPP) を使用したコンピューターから Bluetooth Classic デバイスへの接続を表します。bluetoothlist 出力の "Ready to connect" ステータスで接続先の近くにあるデバイスを特定します。MATLAB® からデバイスに接続する前に、デバイスをコンピューターとペアリングしなければなりません。
作成
構文
説明
は最後に正常に接続された Bluetooth Classic デバイスへの接続を作成します。device = bluetooth
は、その名前を使用して Bluetooth Classic デバイスへの接続を作成します。チャネルは既定の SPP チャネル 1 です。入力 device = bluetooth(name)name は Name プロパティを設定します。
は、Bluetooth Classic デバイスの指定された SPP チャネル device = bluetooth(name,channel)channel への接続を作成します。入力 channel は Channel プロパティを設定します。
は、そのアドレスを使用して Bluetooth Classic デバイスへの接続を作成します。入力 device = bluetooth(address)address は Address プロパティを設定します。
は、Bluetooth Classic デバイスの指定された SPP チャネル device = bluetooth(address,channel)channel への接続を作成します。
は、接続を作成し、1 つ以上の名前と値のペアの引数を使用して追加のプロパティを設定します。名前と値のペア引数を使用して device = bluetooth(address,channel,Name,Value)ByteOrder プロパティと Timeout プロパティを設定します。各プロパティ名を引用符で囲み、その後に必要なプロパティ値を指定します。
例: device = bluetooth("23E16522A7C0",2,"ByteOrder","little-endian","Timeout",10) は、リトルエンディアンのバイト順と 10 秒のタイムアウト期間を使用して Bluetooth デバイスに接続します。
プロパティ
オブジェクト関数
read | Bluetooth デバイスからのデータの読み取り |
readline | Bluetooth デバイスからの ASCII 文字列データ行の読み取り |
write | データを Bluetooth デバイスに書き込む |
writeline | Bluetooth デバイスへの ASCII データ行の書き込み |
configureTerminator | Bluetooth デバイスとの ASCII 文字列通信の終端文字を設定 |
configureCallback | Bluetooth デバイスと通信するためのコールバック関数とトリガー条件の設定 |
flush | Bluetooth デバイスのバッファーのクリア |
例
バージョン履歴
R2020b で導入