summaryrefslogtreecommitdiff
path: root/src/service.h
diff options
context:
space:
mode:
authorArman Uguray <armansito@chromium.org>2014-12-16 18:07:11 -0800
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2014-12-17 11:11:38 -0200
commit9eaab34af829cef3c8a1557a45c93c22f9110ec1 (patch)
treee283ed08f63dcaa053a309ef8d265066ad93705f /src/service.h
parent06d8b53447f19d42e81e38e2c640d27532625b35 (diff)
downloadbluez-9eaab34af829cef3c8a1557a45c93c22f9110ec1.tar.gz
core: service: Add start & end handle fields
When GATT services are discovered, added, and removed, profiles will be notified using btd_profile device_probe and device_remove functions. Since a single profile may handle multiple services from the same device, it is useful to distinguish each btd_service by its service handle range. This patch adds the start_handle and end_handle fields to btd_service and an accessor for getting them, which reports failure if the service was initialized without handles.
Diffstat (limited to 'src/service.h')
-rw-r--r--src/service.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/service.h b/src/service.h
index 5230115cb..857e6886e 100644
--- a/src/service.h
+++ b/src/service.h
@@ -44,6 +44,10 @@ void btd_service_unref(struct btd_service *service);
/* Service management functions used by the core */
struct btd_service *service_create(struct btd_device *device,
struct btd_profile *profile);
+struct btd_service *service_create_gatt(struct btd_device *device,
+ struct btd_profile *profile,
+ uint16_t start_handle,
+ uint16_t end_handle);
int service_probe(struct btd_service *service);
void service_remove(struct btd_service *service);
@@ -57,6 +61,9 @@ struct btd_device *btd_service_get_device(const struct btd_service *service);
struct btd_profile *btd_service_get_profile(const struct btd_service *service);
btd_service_state_t btd_service_get_state(const struct btd_service *service);
int btd_service_get_error(const struct btd_service *service);
+bool btd_service_get_gatt_handles(const struct btd_service *service,
+ uint16_t *start_handle,
+ uint16_t *end_handle);
unsigned int btd_service_add_state_cb(btd_service_state_cb cb,
void *user_data);