diff --git a/attrib/att.h b/attrib/att.h
index 93b58dc..3b8c098 100644
--- a/attrib/att.h
+++ b/attrib/att.h
#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
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
*/
#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
#include <bluetooth/uuid.h>
#include <bluetooth/sdp.h>
+#include "att.h"
#include "gattrib.h"
#include "gatt.h"
#include "btio.h"
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
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
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 */
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);