Callback to verify if the advertisement is turned on/off

16 views
Skip to first unread message

Justin John

unread,
Aug 5, 2021, 5:22:44 AM8/5/21
to btstack-dev
Hi,

I am using bluetooth classic on bluetoot kitchen stack and was wondering how would I verify in the program if the advertisement is turned on and off. I suppose the packet_handler callback should be knowing when the advertisement is on/off.

To start advertising I am calling the api gap_connectable_control(1) and to stop advertising I am calling the same api with argument as 0. Is this correct?


Thanks,
Justin



Matthias Ringwald

unread,
Aug 5, 2021, 4:01:37 PM8/5/21
to btsta...@googlegroups.com
Hi Justin

gap_connectable_control() controls the BR/EDR (Classic) Page Scan Mode. For LE, you would call gap_advertisements_enable(on/off) after setting adv params with gap_advertisements_set_params and data with gap_advertisements_set_data

Why would you need to verify that? If you insist, you can check if you get a HCI Command Complete for LE Advertisements Enable with status code = 0. (but you still need to trust the stack that it sends on / off as you expect)

Cheers
Matthias
> --
> You received this message because you are subscribed to the Google Groups "btstack-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to btstack-dev...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/btstack-dev/f35be16b-feac-4717-85b2-f0a417c41a8cn%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages