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

How can I use directed advertizing when my application reset or wake up from sd_power_system_off?

Hi, every one,

In my application , we need to bond my device with host , and then our application will go to deep sleep by calling sd_power_system_off. When I wake up my application by a wake up pin, how to do the directed advertizing when I had bonded my device with host successfully before?

  • Yes, I know this can do directed advertising, but in my description as above, our application will go to deep sleep by calling sd_power_system_off, after that, when our device wake up from deep sleep, the bonded handle had lost. So we can't go to the direct advertising successfully, and then the whitelist advertising will replace the directed advertising.

  • You have to use device manager, Make sure that you are bonding, not just pairing because only bond information is stored on flash (if you use device manager) device manager will read flash and take out the bond information when booting up. So using it will be effective in your case when the system is waking up from deep sleep.

  • yes, I am sure that my device had been bonded, and how can I get the bonded information for directed advertising at my boot up or wake up ? Any API or I need to get this information from flash by myself?

  • If you want to manage your flash directly use PSTORAGE API. Else you can use device_manager API (which internally uses pstorage) to manage your bond information.

    If you are directly using pstorage, then you need to write the bonded peer address to the flash before going to sleep. Look in the documentation how you do load and store of your data. Your Pstorage handle will be same after bootup as long as your registration sequence does not differ from the one that was before going to system off.

    Doing a directed advertising after waking up from system off is not recommended. Some devices (phones) uses Random resolvable addresses that change after some 15 mins or so. If your device wakes up after that time, then the peer you have bonded would have already changed its address. That is why you have to use IRK and preferably use this in whilelisting for your device while advertising. Then you would not have the above mentioned problem. I do not know if you already considered this in your design.

    Also look at this information. It is little outdated (as we now have device manager instead of bond manager) but the rest of the information still holds.

Related