Diff between f194be5c746d1ad6f093d1b175b7b0e1ccafad58 and 1f8969c0435f8d49c20f46dba9bece21031997c7

Changed Files

File Additions Deletions Status
attrib/att.h +3 -0 modified
attrib/client.c +1 -1 modified
attrib/gatt.h +0 -2 modified
attrib/utils.c +2 -1 modified
src/adapter.c +1 -1 modified
src/device.c +3 -2 modified

Full Patch

diff --git a/attrib/att.h b/attrib/att.h
index 93b58dc..3b8c098 100644
--- a/attrib/att.h
+++ b/attrib/att.h
@@ -110,6 +110,9 @@
 #define ATT_DEFAULT_L2CAP_MTU			48
 #define ATT_DEFAULT_LE_MTU			23
 
+#define ATT_CID					4
+#define ATT_PSM					31
+
 /* Requirements for read/write operations */
 enum {
 	ATT_NONE,		/* No restrictions */
diff --git a/attrib/client.c b/attrib/client.c
index 2dd70c9..71df532 100644
--- a/attrib/client.c
+++ b/attrib/client.c
@@ -384,7 +384,7 @@ static int l2cap_connect(struct gatt_service *gatt, GError **gerr,
 		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_CID, ATT_CID,
 			BT_IO_OPT_SEC_LEVEL, BT_IO_SEC_LOW,
 			BT_IO_OPT_INVALID);
 	else
diff --git a/attrib/gatt.h b/attrib/gatt.h
index 01c651e..c5f95ac 100644
--- a/attrib/gatt.h
+++ b/attrib/gatt.h
@@ -23,8 +23,6 @@
  */
 #include <bluetooth/sdp.h>
 
-#define GATT_CID 4
-
 typedef void (*gatt_cb_t) (GSList *l, guint8 status, gpointer user_data);
 
 guint gatt_discover_primary(GAttrib *attrib, bt_uuid_t *uuid, gatt_cb_t func,
diff --git a/attrib/utils.c b/attrib/utils.c
index 5f4444a..22d23a4 100644
--- a/attrib/utils.c
+++ b/attrib/utils.c
@@ -30,6 +30,7 @@
 #include <bluetooth/uuid.h>
 #include <bluetooth/sdp.h>
 
+#include "att.h"
 #include "gattrib.h"
 #include "gatt.h"
 #include "btio.h"
@@ -84,7 +85,7 @@ GIOChannel *gatt_connect(const gchar *src, const gchar *dst,
 		chan = bt_io_connect(BT_IO_L2CAP, connect_cb, NULL, NULL, &err,
 				BT_IO_OPT_SOURCE_BDADDR, &sba,
 				BT_IO_OPT_DEST_BDADDR, &dba,
-				BT_IO_OPT_CID, GATT_CID,
+				BT_IO_OPT_CID, ATT_CID,
 				BT_IO_OPT_OMTU, mtu,
 				BT_IO_OPT_SEC_LEVEL, sec,
 				BT_IO_OPT_INVALID);
diff --git a/src/adapter.c b/src/adapter.c
index 7e9ceac..8dbd62c 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -2016,7 +2016,7 @@ static void create_stored_device_from_profiles(char *key, char *value,
 	device_probe_drivers(device, uuids);
 	list = device_services_from_record(device, uuids);
 	if (list)
-		device_register_services(connection, device, list, 31);
+		device_register_services(connection, device, list, ATT_PSM);
 
 	g_slist_foreach(uuids, (GFunc) g_free, NULL);
 	g_slist_free(uuids);
diff --git a/src/device.c b/src/device.c
index 72774bf..b0a6542 100644
--- a/src/device.c
+++ b/src/device.c
@@ -1442,7 +1442,8 @@ static void search_cb(sdp_list_t *recs, int err, gpointer user_data)
 
 		list = device_services_from_record(device, req->profiles_added);
 		if (list)
-			device_register_services(req->conn, device, list, 31);
+			device_register_services(req->conn, device, list,
+								ATT_PSM);
 	}
 
 	/* Remove drivers for services removed */
@@ -1660,7 +1661,7 @@ int device_browse_primary(struct btd_device *device, DBusConnection *conn,
 	io = bt_io_connect(BT_IO_L2CAP, gatt_connect_cb, req, NULL, NULL,
 				BT_IO_OPT_SOURCE_BDADDR, &src,
 				BT_IO_OPT_DEST_BDADDR, &device->bdaddr,
-				BT_IO_OPT_CID, GATT_CID,
+				BT_IO_OPT_CID, ATT_CID,
 				BT_IO_OPT_SEC_LEVEL, sec_level,
 				BT_IO_OPT_INVALID);