diff options
author | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2020-01-07 11:47:49 -0800 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2020-03-02 14:42:35 -0800 |
commit | cc441474e77d098c84a9b4140d5e213ccef5d12e (patch) | |
tree | b63b1212a82e55ec128c1efc64a80322af6d56d4 /src/gatt-database.c | |
parent | b8b59af4e88069cb2f67b0168113aa489f6e1fe9 (diff) | |
download | bluez-cc441474e77d098c84a9b4140d5e213ccef5d12e.tar.gz |
core: Add support for setting the number of GATT bearers
This adds option to set the numbers of GATT Channels/Bearers to be
connected in main.conf.
Diffstat (limited to 'src/gatt-database.c')
-rw-r--r-- | src/gatt-database.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/gatt-database.c b/src/gatt-database.c index 245d33af6..c11d14b41 100644 --- a/src/gatt-database.c +++ b/src/gatt-database.c @@ -1215,10 +1215,13 @@ static void populate_gatt_service(struct btd_gatt_database *database) &uuid, BT_ATT_PERM_READ, BT_GATT_CHRC_PROP_READ, db_hash_read_cb, NULL, database); - bt_uuid16_create(&uuid, GATT_CHARAC_SERVER_FEAT); - database->eatt = gatt_db_service_add_characteristic(service, + /* Only enable EATT if there is a socket listening */ + if (database->eatt_io) { + bt_uuid16_create(&uuid, GATT_CHARAC_SERVER_FEAT); + database->eatt = gatt_db_service_add_characteristic(service, &uuid, BT_ATT_PERM_READ, BT_GATT_CHRC_PROP_READ, server_feat_read_cb, NULL, database); + } gatt_db_service_set_active(service, true); @@ -3564,6 +3567,10 @@ struct btd_gatt_database *btd_gatt_database_new(struct btd_adapter *adapter) goto fail; } + /* If just just 1 channel is enabled EATT is not required */ + if (main_opts.gatt_channels == 1) + goto bredr; + /* EATT socket */ database->eatt_io = bt_io_listen(connect_cb, NULL, NULL, NULL, &gerr, @@ -3579,6 +3586,7 @@ struct btd_gatt_database *btd_gatt_database_new(struct btd_adapter *adapter) goto fail; } +bredr: /* BR/EDR socket */ database->bredr_io = bt_io_listen(connect_cb, NULL, NULL, NULL, &gerr, BT_IO_OPT_SOURCE_BDADDR, addr, |