aboutsummaryrefslogtreecommitdiffstats
path: root/attrib/client.c
diff options
context:
space:
mode:
authorVinicius Costa Gomes <vinicius.gomes@openbossa.org>2011-03-28 19:40:50 -0300
committerJohan Hedberg <johan.hedberg@nokia.com>2011-03-30 19:15:54 +0300
commita0b6c596e9bc3873cc150d0663a792b79d591efa (patch)
tree40edceaab7811bfdf2e91b03ddfd8626336120d2 /attrib/client.c
parentfc19dbe0d03b4d142934ca1544a76e5ad91ee827 (diff)
downloadbluez-a0b6c596e9bc3873cc150d0663a792b79d591efa.tar.gz
bluez-a0b6c596e9bc3873cc150d0663a792b79d591efa.tar.xz
bluez-a0b6c596e9bc3873cc150d0663a792b79d591efa.zip
Add support for re-using the attrib channel
In some cases, when the device is already connected there's no need to create another GAttrib instance. This will allow the Attrib client to use the connection already estabilished, this will be very useful when we support more LE profiles.
Diffstat (limited to 'attrib/client.c')
-rw-r--r--attrib/client.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/attrib/client.c b/attrib/client.c
index acd35f93..28e57042 100644
--- a/attrib/client.c
+++ b/attrib/client.c
@@ -1046,7 +1046,8 @@ static void register_primaries(struct gatt_service *gatt, GSList *primaries)
}
int attrib_client_register(DBusConnection *connection,
- struct btd_device *device, int psm, GSList *primaries)
+ struct btd_device *device, int psm,
+ GAttrib *attrib, GSList *primaries)
{
struct btd_adapter *adapter = device_get_adapter(device);
const char *path = device_get_path(device);
@@ -1065,6 +1066,9 @@ int attrib_client_register(DBusConnection *connection,
bacpy(&gatt->dba, &dba);
gatt->psm = psm;
+ if (attrib)
+ gatt->attrib = g_attrib_ref(attrib);
+
register_primaries(gatt, primaries);
gatt_services = g_slist_append(gatt_services, gatt);