Bluetooth: provide struct bt_gatt_indicate_params
to bt_gatt_indicate_func_t
#28688
Labels
Enhancement
Changes/Updates/Additions to existing features
Is your enhancement proposal related to a problem? Please describe.
As noted by the function documentation,
bt_gatt_indicate
is an asynchronous function, and therefore thestruct bt_gatt_indicate_params
provided to it must valid while it is active. The required lifetime of thestruct bt_gatt_indicate_params
is presumably until the member functionbt_gatt_indicate_func_t
is called (this is not specified). Currently, it is not possible to determine from the callback whichstruct bt_gatt_indicate_params
is now available to be reused.This is an issue when multiple indications need to be queued, with the structs allocated from some kernel mechanism (k_mem_slab or other), as there is no way to free the instances once they are no longer needed.
Describe the solution you'd like
const struct bt_gatt_attr *attr
parameter tobt_gatt_indicate_func_t
changed tostruct bt_gatt_indicate_params *params
.The attr element is still accessible from the
*params
, but the params instance can also be freed in the callback.Describe alternatives you've considered
None, there is no user data parameter or similar to retrieve the
struct bt_gatt_indicate_params
pointer from the completing indication.The text was updated successfully, but these errors were encountered: