2posts / 0 new
Last post
hssmltd
Offline
Last seen:4 months 3 weeks ago
加入:2015-09-05 08:29
SDK5 ble_app_barebone

Hi,
Is it possible to modify ble_app_barebone to switch from ADV_UNDIRECT to ADV_NON_CONN advertising mode?

thanks!

Device:
MT_dialog
Offline
Last seen:3 days 12 hours ago
工作人员
加入:2015-06-08 11:34
Hi hssmltd,

Hi hssmltd,

Yes you can all you ve got to do is to change in the user_app_adv_start() the functions that start the undirected advertising to the functions that start the non-connectable advertising (functions from app_easy_gap.c file)

cmd = app_easy_gap_non_connectable_advertise_get_active();
//cmd = app_easy_gap_undirected_advertise_get_active();

app_easy_gap_non_connectable_advertise_start();
//app_easy_gap_undirected_advertise_start();

Also you have to place the app_easy_gap_non_connectable_advertise_get_active() function in the app_easy_gap.h file.

At some point when advertising in non-connectable mode the advertising will stop due to the timer that updates the data, in order to start it again in non-connectable mode you will have to implement a function that handles the completetion of the non-connectable advertising (you will have to use the catch_rest function and catch the non-connectable completettion), and start again the advertising in non-connectable mode.