summaryrefslogtreecommitdiff
path: root/src/profile.h
diff options
context:
space:
mode:
authorMikel Astiz <mikel.astiz@bmw-carit.de>2013-04-26 08:17:15 +0200
committerJohan Hedberg <johan.hedberg@intel.com>2013-04-26 10:29:36 +0300
commitd6254b41132baa8797f79e55446939495dc3f514 (patch)
tree93313b8d587613cfa70ee53473f6535de2701bdf /src/profile.h
parent266635500b47329d5365b8f84565e1ea9324972c (diff)
downloadbluez-d6254b41132baa8797f79e55446939495dc3f514.tar.gz
profile: Use btd_service for probing profiles
Change the profile probe mechanism in order to pass the btd_service instance representing the remote service. This object is bound to a btd_profile and a btd_device, thus replacing the previous parameters. The probe callback is allowed to hold a reference to the btd_service by means of btd_service_ref(), which should be unreferenced during removal. Keeping such a reference of the btd_service allows supporting multiple instances of the same UUID, since the reference can serve as a handle during the interactions between the profile implementation and the core.
Diffstat (limited to 'src/profile.h')
-rw-r--r--src/profile.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/profile.h b/src/profile.h
index 5622f23ba..8daa358d7 100644
--- a/src/profile.h
+++ b/src/profile.h
@@ -25,6 +25,8 @@
#define BTD_PROFILE_PRIORITY_MEDIUM 1
#define BTD_PROFILE_PRIORITY_HIGH 2
+struct btd_service;
+
struct btd_profile {
const char *name;
int priority;
@@ -34,9 +36,8 @@ struct btd_profile {
bool auto_connect;
- int (*device_probe) (struct btd_profile *p, struct btd_device *device);
- void (*device_remove) (struct btd_profile *p,
- struct btd_device *device);
+ int (*device_probe) (struct btd_service *service);
+ void (*device_remove) (struct btd_service *service);
int (*connect) (struct btd_device *device,
struct btd_profile *profile);