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

Advertisement is happening after calling ble_disconnect

Hi All,

We have been working on Arduino Mega board with BLE shield.

ble_disconnect API is added in latest RedBearLab/nRF8001 Library Code. We have integrated the latest nRF8001 Library with our application. We have started advertisement by ble_begin API. Broadcasting the advertisement packet is success.

We are calling ble_disconnect API to Stop the Advertisement. Even if we call ble_disconnect API, Advertisement is still in progress. Once the client (android client) gets connected and do disconnect with Arduino Server, then advertisement gets stopped.

I feel, advertisement should stop immediately after calling ble_disconnect api. Please share your opinion.

Parents
  • According to the docs, the disconnect command is meant to terminate an active connection, not to stop advertisements. The documentation mentions that this command is only available in the Connect or Bond mode after device is connected (i.e. after the controller has received a Connected Event).

    You want to set a proper timeout in the Connect() if you want to stop advertising after some time, or reset the radio in the worst case.

Reply
  • According to the docs, the disconnect command is meant to terminate an active connection, not to stop advertisements. The documentation mentions that this command is only available in the Connect or Bond mode after device is connected (i.e. after the controller has received a Connected Event).

    You want to set a proper timeout in the Connect() if you want to stop advertising after some time, or reset the radio in the worst case.

Children
No Data
Related