実現したいこと
・arduino nano 33 BLEのマイコンを使って周りにあるbluetoothデバイスからserviceUUIDを表示するプログラムを作りたいのだが、serviceUUIDが出てこないので、表示できるようにしたい。下記のプログラムはUUIDが表示するプログラムだがなぜ表示されない。何が原因かわからないので、わかる方がいらっしゃいましたらご教授お願いします。
前提
serviceUUIDを表示させる理由は、携帯デバイスと周辺機器を区別するためである。
発生している問題・エラーメッセージ
servise UUIDを表示できない Phone count: 0 Peripheral count: 0 しか表示されない。
該当のソースコード
#include <ArduinoBLE.h> #define SPP_UUID "00001101-0000-1000-8000-00805F9B34FB" // Serial Port Profile (SPP) #define HFP_UUID "0000111E-0000-1000-8000-00805F9B34FB" // Hands-Free Profile (HFP) #define A2DP_UUID "0000110A-0000-1000-8000-00805F9B34FB" // Advanced Audio Distribution Profile (A2DP) #define MAP_UUID "00001132-0000-1000-8000-00805F9B34FB" // Message Access Profile (MAP) int phoneCount = 0; int peripheralCount = 0; void setup() { Serial.begin(115200); Serial.println("Scanning..."); if (!BLE.begin()) { Serial.println("starting BLE failed!"); while (1); } BLE.scanForUuid(SPP_UUID); BLE.scanForUuid(HFP_UUID); BLE.scanForUuid(A2DP_UUID); BLE.scanForUuid(MAP_UUID); delay(5000); // Scanning for 5 seconds Serial.print("Phone count: "); Serial.println(phoneCount); Serial.print("Peripheral count: "); Serial.println(peripheralCount); } void loop() { // Empty loop }
試したこと
esp-wroom-32で試したが、serviceUUIDが全部NULLと表示はされた。思ってたのは違う結果となった。arduino nano 33 BLEはBluetoothのverが高いことから買ったが、serviceUUIDが出てこない。
補足情報(FW/ツールのバージョンなど)
ここにより詳細な情報を記載してください。

バッドをするには、ログインかつ
こちらの条件を満たす必要があります。