Hi, I'm trying to use my device in the broadcaster role, but so far I've been unable to do it. I'm using the ble_app_barebone example to do it.
I'm change the parameters .role and .mode in the config.h file from GAP_ROLE_PERIPHERAL and GAP_LIM_DISCOVERABLE to GAP_ROLE_PERIPHERAL and GAP_BROADCASTER_MODE, respectively.
I've also changed the gap start function, from app_easy_gap_undirected_advertise_start() to app_easy_gap_non_connectable_advertise_start() in the user_barebone.c file.
Even with this changes, when I run the application it stops and goes to NMI_Handler.
我遗漏了什么东西?
Thanks in advance.
Keywords:
Device:

Hi TMiranda,
When a device acts as a broadcaster, that means that its able to support only non-connectable advertising. Please follow the steps below in order to configure your device as broadcaster. I made these steps in the ble_app_barebone example of the SDK 5.0.4.
.app_on_adv_undirect_complete = user_app_adv_undirect_complete,
Thanks, PM_Dialog
Hi, thanks for the fast answer.
I'm doing the above mentioned, but I'm facing the following error:
"error: #20: identifier "user_app_on_adv_nonconn_complete" is undefined
.app_on_adv_nonconn_complete = user_app_on_adv_nonconn_complete,"
I'm adding the user_app_on_adv_nonconn_complete() function on the user_barebone.c file this way:
"void user_app_on_adv_nonconn_complete(uint8_t status)
{
// If advertising was canceled then update advertising data and start advertising again
if (status == GAP_ERR_CANCELED)
{
user_app_adv_start();
}
}"
Which is equal to the app_easy_gap_undicrect_advertise_start().
Then, I'm calling it on the user_callback_config.h like this:
" .app_on_adv_nonconn_complete = user_app_on_adv_nonconn_complete,"
I've also followed all the other steps too. Is there something I'm missing?
Hi TMiranda,
You should make a reference of the user_app_on_adv_nonconn_complete() function into the ble_app_barebone.h header file. Please, how we define all our user application function. So, please add this code snippet into the ble_app_barebone.h:
void user_app_on_adv_nonconn_complete(uint8_t status);
Thanks, PM_Dialog
Yep, everything working fine. Thanks!