diff --git a/src/device.c b/src/device.c
index 17d023a..39416de 100644
--- a/src/device.c
+++ b/src/device.c
static void gatt_client_init(struct btd_device *device)
{
+ uint8_t features;
+
gatt_client_cleanup(device);
if (!device->connect && !btd_opts.reverse_discovery) {
return;
}
+ features = BT_GATT_CHRC_CLI_FEAT_ROBUST_CACHING
+ | BT_GATT_CHRC_CLI_FEAT_NFY_MULTI;
+ if (btd_opts.gatt_channels > 1)
+ features |= BT_GATT_CHRC_CLI_FEAT_EATT;
+
device->client = bt_gatt_client_new(device->db, device->att,
- device->att_mtu, 0);
+ device->att_mtu, features);
if (!device->client) {
DBG("Failed to initialize");
return;
diff --git a/src/gatt-database.c b/src/gatt-database.c
index 7a105b8..239a0dc 100644
--- a/src/gatt-database.c
+++ b/src/gatt-database.c
goto done;
}
- value |= BT_GATT_CHRC_SERVER_FEAT_EATT;
+ if (btd_opts.gatt_channels > 1)
+ value |= BT_GATT_CHRC_SERVER_FEAT_EATT;
done:
gatt_db_attribute_read_result(attrib, id, ecode, &value, sizeof(value));
diff --git a/src/shared/gatt-client.c b/src/shared/gatt-client.c
index 9db3f52..41a5c6f 100644
--- a/src/shared/gatt-client.c
+++ b/src/shared/gatt-client.c
handle = gatt_db_attribute_get_handle(attr);
- client->features = BT_GATT_CHRC_CLI_FEAT_ROBUST_CACHING;
+ client->features |= BT_GATT_CHRC_CLI_FEAT_ROBUST_CACHING;
bt_uuid16_create(&uuid, GATT_CHARAC_SERVER_FEAT);
gatt_db_attribute_read(attr, 0, BT_ATT_OP_READ_REQ,
NULL, server_feat_read_value,
&feat);
- if (feat && feat[0] & BT_GATT_CHRC_SERVER_FEAT_EATT)
- client->features |= BT_GATT_CHRC_CLI_FEAT_EATT;
+ if (!(feat && feat[0] & BT_GATT_CHRC_SERVER_FEAT_EATT)
+ || !(client->features & BT_GATT_CHRC_CLI_FEAT_EATT))
+ client->features &= ~BT_GATT_CHRC_CLI_FEAT_EATT;
}
+
client->features |= BT_GATT_CHRC_CLI_FEAT_NFY_MULTI;
DBG(client, "Writing Client Features 0x%02x", client->features);