Commit: a1952acd058f63876ffb04c4216d715b811fdd43
Parent: d3c9f0e9b008cb2458cea86ff7aa07530a673a82
Author: Arman Uguray <armansito@chromium.org>
Committer: Marcel Holtmann <marcel@holtmann.org>
Date: 2014-09-11 03:57:34
Tree: 0c2c39e84947d0cfb4dbec570f4957605016f3ea

shared/gatt-client: Implement bt_gatt_client_register_notify. This patch introduces the bt_gatt_client_register_notify and bt_gatt_client_unregister_notify functions and implements the latter. The bt_gatt_client_register_notify function does the following: - If the given characteristic has a CCC descriptor, it writes to it based on which notify/indicate properties are present in the characteristic properties bit field. - It maintains a per-characteristic count of how many callbacks have been registered, so that the CCC descriptor is written to only if the count is 0. - It stores the passed in callback and user data in bt_gatt_client, which will be invoked when a notification/indication is received from the corresponding characteristic. - It queues register requests if the count is 0 and a CCC write is pending, and processes them once the write request has completed.

Diffstat

M src/shared/gatt-client.c | 361 ++++++++++++++++++++++++++++++++++++++++- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
M src/shared/gatt-client.h | 25 +++++++++++++++++++++++++

2 files changed, 347 insertions(+), 39 deletions(-)

View Full Diff | Patch