shared/gatt: Make discovery operations cancelable

System Internals / BlueZ - Arman Uguray [chromium.org] - 27 February 2015 21:58 UTC

This patch makes discovery operations cancelable by exposing the internal discovery op structure as bt_gatt_async_req. This structure keeps track of the ATT request ids of discovery procedures that occur over multiple ATT protocol requests.

Users can cancel an ongoing request by calling bt_gatt_async_req_cancel. Each discovery helper function returns a pointer to the structure with one addition reference count assigned to the caller, so the caller is responsible for cleaning up the memory by calling bt_gatt_async_req_unref.

eb5e467 shared/gatt: Make discovery operations cancelable
src/shared/gatt-helpers.c | 252 ++++++++++++++++++++++++++-------------------
src/shared/gatt-helpers.h | 37 ++++---
2 files changed, 167 insertions(+), 122 deletions(-)

Upstream: git.kernel.org


  • Share