Closed amorniroli closed 8 months ago
Hi Alessandro. The hci_connection_init just initialized the hci connection timer. It is set for the first time on HCI_EVENT_CONNECTION_COMPLETE_EVENT here: https://github.com/bluekitchen/btstack/blob/272986f17af35a67815ab20897f6c91e710322a4/src/hci.c#L3733
Bluetooth itself does not define any kind of timeout on the HCI level (there are timeouts on higher level, e.g. during L2CAP setup). BTstack disconnects an idle HCI Connection == a connection without any L2CAP Channels after 10 seconds.
Hi Alessandro. The hci_connection_init just initialized the hci connection timer. It is set for the first time on HCI_EVENT_CONNECTION_COMPLETE_EVENT here:
https://github.com/bluekitchen/btstack/blob/272986f17af35a67815ab20897f6c91e710322a4/src/hci.c#L3733
Bluetooth itself does not define any kind of timeout on the HCI level (there are timeouts on higher level, e.g. during L2CAP setup). BTstack disconnects an idle HCI Connection == a connection without any L2CAP Channels after 10 seconds.
Hi @mringwal ,
thanks for the description.
In my scenario, I try to connect to bonded devices, in the same order they were bonded. E.g.:
The connection complete timeout event received by controller is too big (in my case, ~15sec). That's a lot of time for my scenario. So I was thinking to handle timeout by my self at application level.
I'm trying to do that for a2dp. Same steps described above: the only difference is that now I have only 1 phone bonded. So:
Step 3 is failing because avdtp_connect returns "command disallowed".
Connection state remains to 'AVDTP_SIGNALING_CONNECTION_W4_L2CAP_DISCONNECTED'
Am I doing something wrong?
Am I doing something wrong?
Yes :)
The hci connection timeout is only used to discard the connection if it's not used. It's not related to the connection process.
To get shorter timeout for the connection attempt - called paging - , please call gap_set_page_timeout( timeout_in_625ns). The default is 0x6000 => 15 seconds
Am I doing something wrong?
Yes :)
The hci connection timeout is only used to discard the connection if it's not used. It's not related to the connection process.
To get shorter timeout for the connection attempt - called paging - , please call gap_set_page_timeout( timeout_in_625ns). The default is 0x6000 => 15 seconds
Nice! I've missed that function. Thank you very much, now it's working as I was expecting : ) thank you very much
Describe the bug
Not sure if it's a bug.
I've noticed that when HCI connection is created (function hci_connection_init), timer handler hci_connection_timeout_handler is set, but it's never handled/triggered since timer it's not added to btstack timer (using btstack_run_loop_add_timer).
Is this correct?