aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--attrib/client.c58
1 files changed, 29 insertions, 29 deletions
diff --git a/attrib/client.c b/attrib/client.c
index 432dfcd8..c025127a 100644
--- a/attrib/client.c
+++ b/attrib/client.c
@@ -176,6 +176,35 @@ static void append_char_dict(DBusMessageIter *iter, struct characteristic *chr)
dbus_message_iter_close_container(iter, &dict);
}
+static void connect_cb(GIOChannel *chan, GError *gerr, gpointer user_data)
+{
+ struct gatt_service *gatt = user_data;
+ GAttrib *attrib;
+ guint atid;
+
+ if (gerr) {
+ error("%s", gerr->message);
+ goto fail;
+ }
+
+ attrib = g_attrib_new(chan);
+
+ atid = gatt_discover_primary(attrib, 0x0001, 0xffff, primary_cb, gatt);
+ if (atid == 0) {
+ g_attrib_unref(attrib);
+ goto fail;
+ }
+
+ gatt->attrib = attrib;
+ gatt->atid = atid;
+
+ services = g_slist_append(services, gatt);
+
+ return;
+fail:
+ gatt_service_free(gatt);
+}
+
static DBusMessage *get_characteristics(DBusConnection *conn,
DBusMessage *msg, void *data)
{
@@ -960,35 +989,6 @@ fail:
gatt_service_free(gatt);
}
-static void connect_cb(GIOChannel *chan, GError *gerr, gpointer user_data)
-{
- struct gatt_service *gatt = user_data;
- GAttrib *attrib;
- guint atid;
-
- if (gerr) {
- error("%s", gerr->message);
- goto fail;
- }
-
- attrib = g_attrib_new(chan);
-
- atid = gatt_discover_primary(attrib, 0x0001, 0xffff, primary_cb, gatt);
- if (atid == 0) {
- g_attrib_unref(attrib);
- goto fail;
- }
-
- gatt->attrib = attrib;
- gatt->atid = atid;
-
- services = g_slist_append(services, gatt);
-
- return;
-fail:
- gatt_service_free(gatt);
-}
-
int attrib_client_register(bdaddr_t *sba, bdaddr_t *dba, const char *path,
int psm)
{