1 month ago
Advertising interval and app_easy_timer function
Posted byozgurkoc95 points 5 repliesHi all,
I have a DA14531-00FXDEVKT-U (Development Kit-USB).
I modified the Service Data Beacon example and achieved to update the sensor data using the app_easy_timer function. But I am having a problem with the advertising interval. Delay parameter of app_easy_timer affects the advertising interval. For example, in user_config.h, I set the intv_max and intv_min values in the user_adv_conf structure to 1 second. I also set the delay parameter of the app_easy_timer function to 1 second and I see the advertising interval as 2 seconds in nRF Connect. What could be the reason for this? How can I solve this problem?
Thank you in advance.
1 month ago
Hi PM_Dialog,
Thanks for your answer. This is my advertising interval setting:
static const struct advertise_configuration user_adv_conf = { .addr_src = APP_CFG_ADDR_SRC(USER_CFG_ADDRESS_MODE), /// Minimum interval for advertising .intv_min = MS_TO_BLESLOTS(1000), /// Maximum interval for advertising .intv_max = MS_TO_BLESLOTS(1000),
I just start timer in the user_advertise_operation(void). In adv_data_update_timer_cb callback:
- Stop advertising
- Get sensor data
- Restart advertising and timer.
I'm not sure if this algorithm is correct, if you have any other suggestions, I can listen.
1 month ago
Hi ozgurkoc,
步骤应该好所以我不能找到一个ny real reason why this affects the advertising interval. The Adverting interval should b 1000ms as configured in the user_adv_conf.
Thanks, PM_Dialog
4 weeks ago
Hi PM_Dialog,
Thanks for your answer. The problem was solved when I removed the app_easy_gap_advertise_stop() function that I used in the adv_data_update_timer_cb() callback, but this time I cannot update the sensor data. I still do not understand the cause of the problem, but I continue to investigate. I'm waiting for your help.
Thank you in advance.
4 weeks ago
Hi ozgurkoc,
I believe you should stop the advertising, update the advertising string and restart adverting. If you revert back the app_easy_gap_advertise_stop() can you please check the adverting intervals with the Power Profiler?
When the advertising stops, the user_app_adv_undirect_complete() callback it triggered, so can you please check if you are modifying the intervals in this function?
Thanks, PM_Dialog
1 month ago
Hi ozgurkoc,
Thanks for your question. Could you indicate what are the values of the intv_max and intv_min values in the user_adv_conf? Please share a code snippet. FO 1 sec advertising interval should such as :
/// Minimum interval for advertising
.intv_min = MS_TO_BLESLOTS(1000), // 1000 ms
/// Maximum interval for advertising
.intv_max = MS_TO_BLESLOTS(1000), // 1000 ms
To verify the advertising interval, I would recommend using the Power Profiler from the SmartSnippets Toolbox – see the following tutorial :
http://lpccs-docs.dialog-semiconductor.com/Tutorial_SDK6/adv_interval.html
>>I also set the delay parameter of the app_easy_timer function to 1 second
Can you please clarify what the registered callback does when the timer expires?
Thanks, PM_Dialog