aboutsummaryrefslogtreecommitdiffstats
path: root/attrib/client.c
diff options
context:
space:
mode:
authorVinicius Costa Gomes <vinicius.gomes@openbossa.org>2010-12-21 19:26:35 -0200
committerJohan Hedberg <johan.hedberg@nokia.com>2010-12-23 10:30:45 +0200
commit463dbe1bea911129123256b1f4bd9a272d55af87 (patch)
treea2ec58b3b8d8d7da934547609b6853be5010f1d5 /attrib/client.c
parent60987f4afa4da5f955e12d5972c3bac22e1b5ed1 (diff)
downloadbluez-463dbe1bea911129123256b1f4bd9a272d55af87.tar.gz
bluez-463dbe1bea911129123256b1f4bd9a272d55af87.tar.xz
bluez-463dbe1bea911129123256b1f4bd9a272d55af87.zip
Add support for making LE connections to GATT client
Now GATT client should be able to make LE connections. The information used to determine if we should make a LE connection is the psm stored in the gatt_service structure.
Diffstat (limited to 'attrib/client.c')
-rw-r--r--attrib/client.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/attrib/client.c b/attrib/client.c
index 0eadf1ef..21ce4398 100644
--- a/attrib/client.c
+++ b/attrib/client.c
@@ -409,7 +409,15 @@ static int l2cap_connect(struct gatt_service *gatt, GError **gerr,
* Configuration it is necessary to poll the server from time
* to time checking for modifications.
*/
- io = bt_io_connect(BT_IO_L2CAP, connect_cb, gatt, NULL, gerr,
+ if (gatt->psm < 0)
+ io = bt_io_connect(BT_IO_L2CAP, connect_cb, gatt, NULL, gerr,
+ BT_IO_OPT_SOURCE_BDADDR, &gatt->sba,
+ BT_IO_OPT_DEST_BDADDR, &gatt->dba,
+ BT_IO_OPT_CID, GATT_CID,
+ BT_IO_OPT_SEC_LEVEL, BT_IO_SEC_LOW,
+ BT_IO_OPT_INVALID);
+ else
+ io = bt_io_connect(BT_IO_L2CAP, connect_cb, gatt, NULL, gerr,
BT_IO_OPT_SOURCE_BDADDR, &gatt->sba,
BT_IO_OPT_DEST_BDADDR, &gatt->dba,
BT_IO_OPT_PSM, gatt->psm,