ARMmbed / mbed-os-example-ble

BLE demos using mbed OS and mbed cli
Apache License 2.0
134 stars 118 forks source link

Fix advertising end handler #265

Closed AGlass0fMilk closed 4 years ago

AGlass0fMilk commented 5 years ago

Fixed advertising end callback and added deferred pairing request workaround to central device profile

AGlass0fMilk commented 5 years ago

@pan-

I tested this on an nRF52840_DK. The example is able to pair but unable to reconnect (with the same pairing parameters) the next time around it seems.

The advertisingEnd handler was assuming that every call to it was a timeout (maybe deprecated behavior of the BLE stack?) This caused it to terminate the event queue prematurely upon connection with a peer (causing the advertisingEnd handler to be executed).

Please get your hands on an nRF52840_DK or some other BLE-enabled board and make sure the example does what it is supposed to.

I am going to test with the filesystem support enabled soon. I have never been able to get a paired Mbed device to reconnect without unpairing and repairing it. It would be nice to have a working example of how to do this boilerplate Bluetooth behavior.

paul-szczepanek-arm commented 4 years ago

on a sidenote change your editor from tabs to 4 spaces, please

40Grit commented 4 years ago

@ranshe

AGlass0fMilk commented 4 years ago

on a sidenote change your editor from tabs to 4 spaces, please

I will take note of this...

desmond-blue commented 4 years ago

Hi @AGlass0fMilk , with mbed-os/pull/11718, you don't need to defer setLinkSecurity, would you change that and other parts requested by Paul?