summaryrefslogtreecommitdiff
path: root/src/service.h
diff options
context:
space:
mode:
authorMikel Astiz <mikel.astiz@bmw-carit.de>2013-04-26 11:46:24 +0200
committerJohan Hedberg <johan.hedberg@intel.com>2013-04-26 14:48:31 +0300
commit32a4ce9475d5804b854df0ec145c535b11b147a5 (patch)
tree7bf1a988da01baf46ed06d9370fc9f5cbc1126f2 /src/service.h
parenta5c85eabb5e8eb8dfec5066d6e0c0e52cfdb9244 (diff)
downloadbluez-32a4ce9475d5804b854df0ec145c535b11b147a5.tar.gz
service: Add callbacks to track state changes
Extend the btd_service API to support state observers.
Diffstat (limited to 'src/service.h')
-rw-r--r--src/service.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/service.h b/src/service.h
index e3bc6e5d1..6ee8f17f9 100644
--- a/src/service.h
+++ b/src/service.h
@@ -33,6 +33,11 @@ struct btd_service;
struct btd_device;
struct btd_profile;
+typedef void (*btd_service_state_cb) (struct btd_service *service,
+ btd_service_state_t old_state,
+ btd_service_state_t new_state,
+ void *user_data);
+
struct btd_service *btd_service_ref(struct btd_service *service);
void btd_service_unref(struct btd_service *service);
@@ -53,6 +58,10 @@ 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);
+unsigned int btd_service_add_state_cb(btd_service_state_cb cb,
+ void *user_data);
+bool btd_service_remove_state_cb(unsigned int id);
+
/* Functions used by profile implementation */
void btd_service_connecting_complete(struct btd_service *service, int err);
void btd_service_disconnecting_complete(struct btd_service *service, int err);