This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Advertise indefinitely after disconnection?

Other Parts Discussed in Thread: CC2650

I have a project set up, based around project zero and the CC2650  launchpad. At the moment I press a button to start the device advertising, and it adverstises for 30 seconds before stopping, as I would expect since it is set in limited discoverable mode. On disconnecting (accidental or otherwise) the device then re-enters advertising mode for 30 seconds and then stops.

I would like the device to advertise indefinitely after a disconnection occurs. I believe the best way to do this would be to change the advertising mode to 'general discoverable mode' when a device first connects, however I'm not sure what command or function I would use to change the advertising mode..

Also, if there was a way to also check if the disconnection was deliberate or if it was just due to being out of range that would also be very handy.

Can anyone help me out here?

Thanks,

Craig

  • I figured out how to do this eventually. Documenting for anyone else who's looking.

    It would seem that when you update the advertising packet the BLE stack automatically sets the discovery mode based on the value in the packet. It appears that it's enough to simply modify the packet array and do a GAP_SetParameterValue() to apply the update. 

    I did the update of the array before beginning to advertise again. I imagine this might not work if the device is currently advertising.

  • Thanks for letting us know. Yes, to advertise indefinitely required GENERAL Adv mode. This is the behavior for the simple_peripheral sample application. The BLE stack will look at the ADV flags to determine which mode you are using and apply the appropriate timers.

    Best wishes