aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnderson Lizardo <anderson.lizardo@openbossa.org>2010-09-21 16:11:05 -0400
committerJohan Hedberg <johan.hedberg@nokia.com>2010-09-21 23:53:36 +0300
commit4105eac9c54046f9f123005461e6547501b06b13 (patch)
treef4982d3779d0752df8eb4be94e749a6c7eba669a
parent213efa78f37c0fd807f584c756a0cb0f02c86111 (diff)
downloadbluez-4105eac9c54046f9f123005461e6547501b06b13.tar.gz
bluez-4105eac9c54046f9f123005461e6547501b06b13.tar.xz
bluez-4105eac9c54046f9f123005461e6547501b06b13.zip
Move connect_cb() upper in attrib/client.c
This callback will also be used for the watcher implementation, so moving it avoids a forward declaration.
-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)
{