aboutsummaryrefslogtreecommitdiffstats
path: root/attrib/client.c
diff options
context:
space:
mode:
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)