bluekitchen / btstack

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

dis: fix the assert problem caused by function re-entry #557

Closed weigangw closed 10 months ago

weigangw commented 10 months ago

current DIS will cause an assert in GATT_EVENT_CHARACTERISTIC_VALUE_QUERY_RESULT when:

  1. a DIS is doing;
  2. user call func device_information_service_client_query again;

By making a parameter judgment in device_information_service_client_query, the problem will be fixed.

mringwal commented 10 months ago

Thanks for reporting this.

Calling device_information_service_client_query to the same address would return ERROR_CODE_COMMAND_DISALLOWED, but for a different con handle, it hits an assert.

I've added your fix on the develop branch, commit f6a72c8