sandeepmistry / arduino-BLEPeripheral

An Arduino library for creating custom BLE peripherals with Nordic Semiconductor's nRF8001 or nR51822.
MIT License
462 stars 179 forks source link

For HID_keyboard example, how to unbond from device side? #226

Closed DeqingSun closed 6 years ago

DeqingSun commented 6 years ago

Hi,

I'm testing HID_keyboard with Mac but it seems MAC OS will keep trying to connect to the device. The only way to stop it is to SHIFT+OPTION+click BT icon to remove the device.

This will be painful for a class environment when someone connects to a wrong device. I tried to call "disconnect" and it went down to

sd_ble_gap_disconnect(this->_connectionHandle, BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION);

This command can disconnect. But MAC OS will connect again immediately. How can I disconnect and unbond?

Thanks

sandeepmistry commented 6 years ago

The only way to stop it is to SHIFT+OPTION+click BT icon to remove the device.

This is the only have I know to do it unfortunately.