以前のリビジョンの文書です
AdvertiseのDiscoverableを有効にします。
advData.addFlags((GapAdvertisingData::Flags)(GapAdvertisingData::LE_GENERAL_DISCOVERABLE | GapAdvertisingData::BREDR_NOT_SUPPORTED));
ペアリング前に表示されるデバイス名は、AdvertiseにSHORTENED_LOCAL_NAMEを追加します。文字コードはUTF-8です。
const char* deviceName = "\xe3\x81\xa4\xe3\x81\xbcmbedHRM1017"; advData.addData(GapAdvertisingData::SHORTENED_LOCAL_NAME, (uint8_t*)deviceName, strlen(deviceName) + 1);
ペアリング後に表示されるデバイス名は、nrf.init()後にsd_ble_gap_device_name_set()を追加します。
nrf.init(); const char* deviceName = "\xe3\x81\xa4\xe3\x81\xbcmbedHRM1017"; ble_gap_conn_sec_mode_t sec_mode; BLE_GAP_CONN_SEC_MODE_SET_OPEN(&sec_mode); sd_ble_gap_device_name_set(&sec_mode, (const uint8_t*)deviceName, strlen(deviceName));
1. ハードウェアがBluetooth LEに対応しているか確認します。(デバイス マネージャー で、Microsoft Bluetooth LE Enumeratorが表示されていれば、Bluetooth LEに対応しています。)
2. mbed HRM1017をペアリングします。
チャーム > 設定 > PC設定の変更 > PCとデバイス > Bluetooth
デバイスが表示されない場合は、mbed HRM1017のGapAdvertisingData::LE_GENERAL_DISCOVERABLEフラグがONしているか確認してください。
EG Bluetooth Smart Device GATT Profile Checker で確認できます。
1. ストアから、EG Bluetooth Smart Device GATT Profile Checkerをインストールします。
2. EG Bluetooth Smart Device GATT Profile Checkerを起動します。
3.Bluetooth SMART Devicesに表示されているデバイスを選択します。