bug: v/62106
Add feature-layer GATT client (gatt_client_t) wrapping low-level GATTC callbacks.
Build a local services DB from discovery (service/characteristic/descriptor).
Provide stable UUID handle lookups and helpers (service/char/desc finders).
Implement async read/write for characteristics and descriptors, notify subscribe/unsubscribe, and MTU exchange.
Signed-off-by: zhongzhijie1 <zhongzhijie1@xiaomi.com>
../../frameworks/connectivity/bluetooth/framework/btwrap/async/bt_gatt_feature.c: In function 'create_client_cb':
../../frameworks/connectivity/bluetooth/framework/btwrap/async/bt_gatt_feature.c:750:9: error: implicit declaration of function 'assert' [-Werror=implicit-function-declaration]
750 | assert(0);
| ^~~~~~
../../frameworks/connectivity/bluetooth/framework/btwrap/async/bt_gatt_feature.c:29:1: note: 'assert' is defined in header '<assert.h>'; did you forget to '#include <assert.h>'?
28 | #include bt_uuid.h
+++ |+#include <assert.h>
29 |
Signed-off-by: haopengxiang <haopengxiang@xiaomi.com>
When deleting a GATTC instance, the Advanced API identifies clients based on their device address. If an application creates two GATTC instances with the same device address, and attempts to delete the second instance before the server has returned the asynchronous callback for the first deletion, both deletion operations will effectively target the same underlying GATTC instance due to the identical device address.
Signed-off-by: jialu <jialu@xiaomi.com>
Signed-off-by: miot-robot <miot-robot@xiaomi.com>
The original bt_gattc_feature_get_service_cb_t callback only returned a
single gatt_service_t pointer. This is insufficient for feature-layer
use cases that require receiving all discovered services at once.
This patch updates the callback signature by adding:
- const gatt_service_t *services[] : array of discovered service pointers
- size_t count : number of services in the array
This allows the feature layer to receive a batch of services in a single
notification and avoids repeated per-service callbacks.
Signed-off-by: zhongzhijie1 <zhongzhijie1@xiaomi.com>
When deleting GATTC, if the application does not provide a callback, the Bluetooth async API cannot be invoked, leading to the inability to release gattc remote list and causing a memory leak.
Signed-off-by: jialu <jialu@xiaomi.com>
Signed-off-by: miot-robot <miot-robot@xiaomi.com>
Add feature-layer GATT client (gatt_client_t) wrapping low-level GATTC callbacks.
Build a local services DB from discovery (service/characteristic/descriptor).
Provide stable UUID handle lookups and helpers (service/char/desc finders).
Implement async read/write for characteristics and descriptors, notify subscribe/unsubscribe, and MTU exchange.
Signed-off-by: zhongzhijie1 <zhongzhijie1@xiaomi.com>