hci_cmd_request_can_send_now_event ?

37 views
Skip to first unread message

Ricardo Quesada

unread,
Mar 24, 2022, 9:29:56 AM3/24/22
to btstack-dev
Hi,

What's the best way to get notified when I can send an HCI command using: hci_send_cmd() ?

I noticed that there are different *_request_can_send_now_event() functions, but there is no "hci_cmd_request_can_send_now_event()".

Thanks!

Matthias Ringwald

unread,
Mar 26, 2022, 12:12:57 PM3/26/22
to btsta...@googlegroups.com
Hi Ricardo

Well, the idea is that it should not be necessary for an application to send HCI commands. We've added quite a number of gap_xxx functions to cover most use cases.
Also, the stack needs to keep track of the Bluetooth Controller state.

What HCI Command(s) do you want to send?

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/2d95701d-29dc-4b21-b5c6-b79abb7d6d35n%40googlegroups.com.

Ricardo Quesada

unread,
Mar 30, 2022, 9:42:56 AM3/30/22
to btstack-dev
Thanks Matthias,

I want to call hci_periodic_inquiry_mode / hci_exit_periodic_inquiry_mode

IIRC, you mentioned that you was going to include a function to call them but I couldn't find it.

Thanks!

Ricardo Quesada

unread,
Apr 6, 2022, 12:10:15 PM4/6/22
to btstack-dev
Hi Matthias,

Do you have any update on this?  Many thanks!

Matthias Ringwald

unread,
Apr 7, 2022, 3:20:34 PM4/7/22
to btsta...@googlegroups.com
Hi Ricardo

Sorry, got distracted. It's only half-forgotten, but I'll get to that.

Best
Matthias
> To view this discussion on the web visit https://groups.google.com/d/msgid/btstack-dev/382aa445-9a8d-4c21-81ee-4f52fba5fb86n%40googlegroups.com.

Ricardo Quesada

unread,
Apr 7, 2022, 3:51:21 PM4/7/22
to btsta...@googlegroups.com
Thanks Matthias. I appreciate it.

You received this message because you are subscribed to a topic in the Google Groups "btstack-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/btstack-dev/1B3a1a7Hr_Q/unsubscribe.
To unsubscribe from this group and all its topics, send an email to btstack-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/btstack-dev/D9DA98EA-7A96-4A18-8441-0AA95EA10219%40gmail.com.

Matthias Ringwald

unread,
Apr 8, 2022, 12:39:08 PM4/8/22
to btsta...@googlegroups.com
Hi Ricardo

The new command is almost implemented. There seems to be an annoying detail in the HCI specification. There seems to be no event that indicates that the duration for which the periodic inquiry has been started is over.
There's an HCI Inquiry Complete, but that is for each individual inquiry process, not for the global one.

What's your actual use case? Do you start it and leave it running? Do you see a case where you would start it for a fixed amount of time?

Cheers
Matthias
> To view this discussion on the web visit https://groups.google.com/d/msgid/btstack-dev/CAK7XcBezKyYzZnEoQBSCUdUwZ9cENHtWTCVbsgr7W%3DC14jDXuw%40mail.gmail.com.

Ricardo Quesada

unread,
Apr 8, 2022, 1:54:57 PM4/8/22
to btsta...@googlegroups.com
Thanks Matthias.

TL;DR: yes, the "periodic inquiry mode" will keep running until certain conditions are met... and those conditions are not related to a fixed time.

Long:
This is part of the Bluepad32 library [1]
It is a library that allows gamepad bluetooth connections. And among other things, it has an Arduino API, so that users can tinker with it.
So, some users might want to keep the "accept bluetooth connections" forever, other might want to stop after certain conditions are met like:
   - a user press a button to "disable" bluetooth
   - or that after the first gamepad is connected
   - etc.

Thanks!



   


Matthias Ringwald

unread,
Apr 12, 2022, 10:27:26 AM4/12/22
to btsta...@googlegroups.com
Hi Ricardo

Well, I misread the spec (the duration is for an individual inquiry round, not for a total). Anyway, please check out develop branch and let me know how it works for you.

Cheers
Matthias
> To view this discussion on the web visit https://groups.google.com/d/msgid/btstack-dev/CAK7XcBc98m_q7rBVd9D%2BVJ5_JSyBbdyzPBCwqT6LPu48hD1hZQ%40mail.gmail.com.

Ricardo Quesada

unread,
Apr 12, 2022, 10:53:20 AM4/12/22
to btsta...@googlegroups.com
Thanks Matthias! I'll check it out tonight.

Ricardo Quesada

unread,
Apr 13, 2022, 12:34:08 AM4/13/22
to btsta...@googlegroups.com
Thanks Matthias,

start() is working Ok.
But stop() was not working. I sent a PR with the fix: https://github.com/bluekitchen/btstack/pull/412

Thanks!

Matthias Ringwald

unread,
Apr 13, 2022, 3:52:51 AM4/13/22
to btsta...@googlegroups.com
Hi Ricardo

Thanks for the fix. Yes, we get a command complete for the periodic inquiry.

Cheers
Matthias
> To view this discussion on the web visit https://groups.google.com/d/msgid/btstack-dev/CAK7XcBfqaxPxC86Jnt%2BEg8%3DnWepbGx%3DUO9ywkzgnmEccFGwaqg%40mail.gmail.com.

Ricardo Quesada

unread,
Apr 13, 2022, 9:45:59 PM4/13/22
to btsta...@googlegroups.com
Thanks Matthias.

One more patch. Needed to be able to call "start()" after a "stop()".

Thanks!


Reply all
Reply to author
Forward
0 new messages