hi!
my project is based on SDK 3.0.10. My device is powered on and starts advertising for about 10s, if there is no any connection, the device will stop adv, then wait for an external wakeup by a button, so my device will start adv again.
How should i do to get above function? Is there some examples to ref ?
thanks!
Keywords:
Device:
Hi z0806020433,
Firstly i would recommend you to move to the latest version of the SDK which is 5.0.4, so has more api's and much more examples in order to check, for example the exact functionallity is implemented on ble_app_sleepmode. If you dont want to move to next SDK the procedure you should follow is to start a timer as soon as you start advertising, in order to count the amount of time that you will be advertising. In the callback of the timer you should just stop advertising by invoking the GAPM_CANCEL_CMD command and set up the wake up controller in the when you get the callback that the advertising has finished. Also as i ve mentioned for this exact case there is an implementation in ble_app_sleepmode in SDK 5.0.4.
Thanks MT_dialog
Thanks very much!
Because the project is developed a long time ago, i just maintain it. My new projects are all based on SDK 5.
I have referenced the project( ble_app_sleepmode) in SDK 5.0.4 to modify the project(based on SDK 3), and run Successfully.