aboutsummaryrefslogtreecommitdiffstats
path: root/attrib/manager.c
diff options
context:
space:
mode:
authorClaudio Takahasi <claudio.takahasi@openbossa.org>2010-07-08 10:38:59 -0300
committerJohan Hedberg <johan.hedberg@nokia.com>2010-08-09 18:06:44 -0400
commit97cd6046573d8acf8d98b0ee35c86126f0505dff (patch)
tree716cfd8dd1ac77baa7ebbedf7b8cdc2f6d36418d /attrib/manager.c
parent5f722b2780dae76a11ecf8822b9aec150cc0e3ff (diff)
downloadbluez-97cd6046573d8acf8d98b0ee35c86126f0505dff.tar.gz
bluez-97cd6046573d8acf8d98b0ee35c86126f0505dff.tar.xz
bluez-97cd6046573d8acf8d98b0ee35c86126f0505dff.zip
Add BR/EDR connection establishment for GATT
Parses the psm for GATT and triggers the L2CAP connection for GATT.
Diffstat (limited to 'attrib/manager.c')
-rw-r--r--attrib/manager.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/attrib/manager.c b/attrib/manager.c
index 11f46fb3..41ab80ac 100644
--- a/attrib/manager.c
+++ b/attrib/manager.c
@@ -25,6 +25,10 @@
#include <config.h>
#endif
+#include <bluetooth/bluetooth.h>
+#include <bluetooth/sdp.h>
+#include <bluetooth/sdp_lib.h>
+
#include "../src/adapter.h"
#include "../src/device.h"
@@ -39,7 +43,10 @@ static int client_probe(struct btd_device *device, GSList *uuids)
{
struct btd_adapter *adapter = device_get_adapter(device);
const char *path = device_get_path(device);
+ const sdp_record_t *rec;
+ sdp_list_t *list;
bdaddr_t sba, dba;
+ int psm;
/*
* Entry point for BR/EDR GATT probe. LE scanning and primary service
@@ -49,10 +56,21 @@ static int client_probe(struct btd_device *device, GSList *uuids)
* discovery and LE scanning.
*/
+ rec = btd_device_get_record(device, GATT_UUID);
+ if (!rec)
+ return -1;
+
+ if (sdp_get_access_protos(rec, &list) < 0)
+ return -1;
+
+ psm = sdp_get_proto_port(list, L2CAP_UUID);
+ if (psm < 0)
+ return -1;
+
adapter_get_address(adapter, &sba);
device_get_address(device, &dba);
- return attrib_client_register(&sba, &dba, path);
+ return attrib_client_register(&sba, &dba, path, psm);
}
static void client_remove(struct btd_device *device)