This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Direct Advertising Not Working

We have a software application for the NRF52 with BLE communication. The communication part is based on nordic example “ble_app_hids_keyboard”.

We are using Softdevice 132 and SDK V12.3 on a nrf52832_xxAA chip. The counter part is a smartphone with Android 6.0 (Wiko Lenny 3) and Android 6.0.1 (Samsung Galaxy A3).

Running directly from SYSTEM_OFF the communication with our android app is always successful. This includes connecting with subsequent read/write access to different GATT characteristics. That is true for connecting to a bonded device as well as bonding to a new smartphone. Interesting is that in these cases my BLE sniffer only shows indirect advertising. In case of an unbonded NRF52 this is expected, but not when it is already bonded and the variables say “direct”.

The main problem occurs when the device gets additional user inputs between disabling Softdevice and before entering the SYSTEM_OFF: In this case the Softdevice and the advertising are restarted. According the BLE sniffer it is advertising directly, but the Android App is unable to connect.

Do you have an idea why only direct advertising should fail?

What content in a valid direct adverting is expected?

My current hack is ignoring the BLE_ADV_EVT_PEER_ADDR_REQUEST event in the AdvertiseEventHandler, which indirectly disables direct advertising. With this change, the device always connects reliable in all cases (using indirect advertising and whitelist) – tested with both smartphones (Lenny 3 and Galaxy A3).

Related