problem about disconnecting device by BTstack

17 views
Skip to first unread message

mikew

unread,
Apr 7, 2024, 4:32:10 AMApr 7
to btstack-dev
Hi,

I want to check if current code supports to free hci connection memory automatically when disconnecting by BTstack.

I use "a2dp_source_disconnect" and "hid_host_disconnect" to test and find the memory can not be freed autoly,  which will possibly cause memory leak. On the other hand, disconnecting by device will trigger hci connection memory free in BTstack.

Is there hasn't been considered before, or is the code designed that way?

Best wishes,
Mike

mikew

unread,
Apr 7, 2024, 4:36:19 AMApr 7
to btstack-dev
The function to trigger is "hci_shutdown_connection" in hid (br/edr), and there is more in audio device.

Matthias Ringwald

unread,
Apr 8, 2024, 4:58:32 AMApr 8
to btsta...@googlegroups.com
Hi Mike

Both a2dp_source_disconnect and hid_host_disconnect disconnect the specified profile, but keep the HCI connection alive in case for up to 10 seconds in case you want to switch to other services.
if you just want to disconnect a remote device, you can call "gap_disconnect".

Best
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/c76f424e-5ff5-4adf-b89d-6366c974d874n%40googlegroups.com.

mikew

unread,
Apr 8, 2024, 5:59:59 AMApr 8
to btstack-dev

Thanks, I will have a try.
Reply all
Reply to author
Forward
0 new messages