Hi,
I have a very simple question: which sleep mode is set during advertising state in the SmartTag ref design?
I have an issue in my project with a timer which help me to drive a blinking LED when in connected state: the duty cycle is really too fast when extended sleep mode is set while it works well when no sleep mode is activated.
Are there some recommandations while using a timer when a sleep mode is activated?
Thanks.
Matt
Dear Matthieu,
The EXTENDED sleep mode is set during advertising in the SmartTag.
As long as the advertising interval is shorther than 2seconds, the EXTENDED sleep mode is more judicious than the DEEP sleep mode.
Above 2seconds, the DEEP sleep mode shall be used.
While sleeping (EXTENDED or DEEP sleep), the timers cannot work.
However you must use the BLE timer which can run during sleep mode.
The BLE timer can be called using: app_timer_set(APP_ADV_TIMER, TASK_APP, 100); //100 means 1second.
The APP_ADV_TIMER must be declared as follow:
{APP_ADV_TIMER, (ke_msg_func_t)app_adv_timer_handler},
in the app_task_handler.h
when the timer is going to reach the time you set in the app_timer_set (1second in this example), the following handler will be triggered:
int app_adv_timer_handler(ke_msg_id_t const msgid,
void const *param,
ke_task_id_t const dest_id,
ke_task_id_t const src_id)
{
}
this handler must be added in the app_task.c file.
hope this helps,
Best regards,
Guillaume.
Thanks for your quick answer.
Is it mandatory to add the handler in app_task.c file?
I still have the issue. To test it, I use the template project in SDK v3.0.4.0. I just added the DISS service as explained in the documentation. Then, I implement the timer (using app_timer_set) when a connection is established to make the LED blinks.
I carry 2 tests:
- with "#undef" for extended and deep sleep in da14580_config.h : it works well
- with #define CFG_EXT_SLEEP, the LED is blinking eratically.
What I am looking for is pretty easy. I need to make a LED blinks when I am connected. So I activate the timer in app_connection_func in app_xxx_proj.c. And the handler is in the same file.
So it seems to come from the activation of the extended sleep mode.
Any idea?
Thanks,
Matt
Hi,
I have something to add: when I modify the "proximity" project to implement what I want to achieve, it works very well, no matter the sleep mode I select. So, I suppose that something specific is done that is not available in the template project. But what is it? I could use the "proximity" project as base to go further... but I need to understand what is happening :-).
In my previous post, when I mention that it does not work, it means that the LED duty cycle is really different from what I specified.
Regards,
Matt
你好Matthiew,其中的一个team from the factory is in contact with you, so i do hope that your problem is solved shortly.
BR JE_Dialog
I also have the same question now ,and I don't know how to solve it.Can you explain it to me ?