bluekitchen / btstack

Dual-mode Bluetooth stack, with small memory footprint.
http://bluekitchen-gmbh.com
Other
1.74k stars 618 forks source link

gatt-client: #525

Closed ricardoquesada closed 1 year ago

ricardoquesada commented 1 year ago

Describe the bug

Regression introduced by: https://github.com/bluekitchen/btstack/commit/7045d3c0508e74262a4882ca3c46d45a91a9ca79

I have my custom code to support BLE gamepads which was based on hog_host_demo. I had to make my custom changes to make ti work and it was working ok.

But after the commit mentioned above my callback hids_client_packet_handler never gets called.

To Reproduce

I don't expect you to check my git repo, but in case you want to the file that handles my BLE gamepad connections is this one: https://github.com/ricardoquesada/bluepad32/blob/main/src/components/bluepad32/uni_bt_le.c

and to repro just do:

cd bluepad32/tools/pc_debug
make -j && ./bluepad32

And try to connect a BLE gamepad like Stadia on Xbox controller with firmware 5.x

Expected behavior hids_client_packet_handler should get called.

HCI Packet Logs

attached. hci_dump.pklg.zip

Environment: (please complete the following information):

Additional context Add any other context about the problem here.

mringwal commented 1 year ago

Hi Ricardo. Thanks for reporting. Sorry for this. The change was wrong (BTstack should not emit an event in case of error as this is reflected in the API return value. In this case, there's no error though). I've reverted the change in b69335b