From a891c1adb541a73aac7dfeb33cce3cae807e1155 Mon Sep 17 00:00:00 2001 From: Arman Uguray Date: Thu, 18 Dec 2014 17:24:34 -0800 Subject: [PATCH] core/device: Add getters for GATT db and client This patch adds btd_device_get_gatt_db and btd_device_get_gatt_client functions. --- src/device.c | 16 ++++++++++++++++ src/device.h | 2 ++ 2 files changed, 18 insertions(+) diff --git a/src/device.c b/src/device.c index 64591d0b7..854d9f30c 100644 --- a/src/device.c +++ b/src/device.c @@ -4844,6 +4844,22 @@ GSList *btd_device_get_primaries(struct btd_device *device) return device->primaries; } +struct gatt_db *btd_device_get_gatt_db(struct btd_device *device) +{ + if (!device) + return NULL; + + return device->db; +} + +struct bt_gatt_client *btd_device_get_gatt_client(struct btd_device *device) +{ + if (!device) + return NULL; + + return device->client; +} + void btd_device_gatt_set_service_changed(struct btd_device *device, uint16_t start, uint16_t end) { diff --git a/src/device.h b/src/device.h index 487bd27d4..a7fefeef8 100644 --- a/src/device.h +++ b/src/device.h @@ -67,6 +67,8 @@ const sdp_record_t *btd_device_get_record(struct btd_device *device, struct gatt_primary *btd_device_get_primary(struct btd_device *device, const char *uuid); GSList *btd_device_get_primaries(struct btd_device *device); +struct gatt_db *btd_device_get_gatt_db(struct btd_device *device); +struct bt_gatt_client *btd_device_get_gatt_client(struct btd_device *device); void btd_device_gatt_set_service_changed(struct btd_device *device, uint16_t start, uint16_t end); bool device_attach_att(struct btd_device *dev, GIOChannel *io); -- 2.47.3