aboutsummaryrefslogtreecommitdiffstats
path: root/attrib/client.c
diff options
context:
space:
mode:
authorClaudio Takahasi <claudio.takahasi@openbossa.org>2011-04-11 15:24:48 -0300
committerJohan Hedberg <johan.hedberg@nokia.com>2011-04-14 20:10:15 +0300
commit8447ce5c943e5b73149321fd4f61ed482c4e9427 (patch)
tree9b6f00d69c89bf4aa4e8acb2c55921c78c6e489a /attrib/client.c
parent5eb9d13c5b75f3659454466d511533c2f413cbbd (diff)
downloadbluez-8447ce5c943e5b73149321fd4f61ed482c4e9427.tar.gz
bluez-8447ce5c943e5b73149321fd4f61ed482c4e9427.tar.xz
bluez-8447ce5c943e5b73149321fd4f61ed482c4e9427.zip
Remove btd_device_add_service function
btd_device_add_service is no longer necessary if the object paths for the primary services can be returned during the registration.
Diffstat (limited to 'attrib/client.c')
-rw-r--r--attrib/client.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/attrib/client.c b/attrib/client.c
index 28e57042..2dd70c94 100644
--- a/attrib/client.c
+++ b/attrib/client.c
@@ -1020,11 +1020,11 @@ static GDBusMethodTable prim_methods[] = {
{ }
};
-static void register_primaries(struct gatt_service *gatt, GSList *primaries)
+static GSList *register_primaries(struct gatt_service *gatt, GSList *primaries)
{
- GSList *l;
+ GSList *l, *paths;
- for (l = primaries; l; l = l->next) {
+ for (paths = NULL, l = primaries; l; l = l->next) {
struct att_primary *att = l->data;
struct primary *prim;
@@ -1040,12 +1040,14 @@ static void register_primaries(struct gatt_service *gatt, GSList *primaries)
DBG("Registered: %s", prim->path);
gatt->primary = g_slist_append(gatt->primary, prim);
- btd_device_add_service(gatt->dev, prim->path);
+ paths = g_slist_append(paths, g_strdup(prim->path));
load_characteristics(prim, gatt);
}
+
+ return paths;
}
-int attrib_client_register(DBusConnection *connection,
+GSList *attrib_client_register(DBusConnection *connection,
struct btd_device *device, int psm,
GAttrib *attrib, GSList *primaries)
{
@@ -1069,11 +1071,9 @@ int attrib_client_register(DBusConnection *connection,
if (attrib)
gatt->attrib = g_attrib_ref(attrib);
- register_primaries(gatt, primaries);
-
gatt_services = g_slist_append(gatt_services, gatt);
- return 0;
+ return register_primaries(gatt, primaries);
}
void attrib_client_unregister(struct btd_device *device)