diff --git a/subsys/bluetooth/host/Kconfig.gatt b/subsys/bluetooth/host/Kconfig.gatt index 82be863a7e2e60..3ada9467c6d236 100644 --- a/subsys/bluetooth/host/Kconfig.gatt +++ b/subsys/bluetooth/host/Kconfig.gatt @@ -37,7 +37,7 @@ config BT_ATT_TX_MAX amount the calls will block until an existing queued PDU gets sent. -config BT_GATT_DB +config BT_GATT_DYNAMIC_DB bool "GATT dynamic database support" default n help @@ -46,7 +46,7 @@ config BT_GATT_DB config BT_GATT_CACHING bool "GATT Caching support" default y - depends on BT_GATT_DB + depends on BT_GATT_DYNAMIC_DB select TINYCRYPT select TINYCRYPT_AES select TINYCRYPT_AES_CMAC diff --git a/subsys/bluetooth/host/gatt.c b/subsys/bluetooth/host/gatt.c index bfe68880f653b6..5e150ecc807ab3 100644 --- a/subsys/bluetooth/host/gatt.c +++ b/subsys/bluetooth/host/gatt.c @@ -17,13 +17,13 @@ #include -#if defined(CONFIG_BT_GATT_DB) +#if defined(CONFIG_BT_GATT_DYNAMIC_DB) #include #include #include #include #include -#endif /* CONFIG_BT_GATT_DB */ +#endif /* CONFIG_BT_GATT_DYNAMIC_DB */ #include #include @@ -183,7 +183,7 @@ BT_GATT_SERVICE_DEFINE(_2_gap_svc, #endif ); -#if defined(CONFIG_BT_GATT_DB) +#if defined(CONFIG_BT_GATT_DYNAMIC_DB) static struct bt_gatt_ccc_cfg sc_ccc_cfg[BT_GATT_CCC_MAX] = {}; static void sc_ccc_cfg_changed(const struct bt_gatt_attr *attr, @@ -489,11 +489,11 @@ static void remove_cf_cfg(struct bt_conn *conn) } } #endif /* CONFIG_BT_GATT_CACHING */ -#endif /* CONFIG_BT_GATT_DB */ +#endif /* CONFIG_BT_GATT_DYNAMIC_DB */ BT_GATT_SERVICE_DEFINE(_1_gatt_svc, BT_GATT_PRIMARY_SERVICE(BT_UUID_GATT), -#if defined(CONFIG_BT_GATT_DB) +#if defined(CONFIG_BT_GATT_DYNAMIC_DB) /* Bluetooth 5.0, Vol3 Part G: * The Service Changed characteristic Attribute Handle on the server * shall not change if the server has a trusted relationship with any @@ -511,10 +511,10 @@ BT_GATT_SERVICE_DEFINE(_1_gatt_svc, BT_GATT_CHRC_READ, BT_GATT_PERM_READ, db_hash_read, NULL, NULL), #endif /* CONFIG_BT_GATT_CACHING */ -#endif /* CONFIG_BT_GATT_DB */ +#endif /* CONFIG_BT_GATT_DYNAMIC_DB */ ); -#if defined(CONFIG_BT_GATT_DB) +#if defined(CONFIG_BT_GATT_DYNAMIC_DB) static int gatt_register(struct bt_gatt_service *svc) { struct bt_gatt_service *last; @@ -632,7 +632,7 @@ static void sc_process(struct k_work *work) atomic_set_bit(sc->flags, SC_INDICATE_PENDING); } -#endif /* CONFIG_BT_GATT_DB */ +#endif /* CONFIG_BT_GATT_DYNAMIC_DB */ #if defined(CONFIG_BT_SETTINGS_CCC_STORE_ON_WRITE) static struct gatt_ccc_store { @@ -699,20 +699,20 @@ void bt_gatt_init(void) last_static_handle += svc->attr_count; } -#if defined(CONFIG_BT_GATT_DB) +#if defined(CONFIG_BT_GATT_DYNAMIC_DB) #if defined(CONFIG_BT_GATT_CACHING) k_delayed_work_init(&db_hash_work, db_hash_process); db_hash_gen(false); #endif /* COFNIG_BT_GATT_CACHING */ k_delayed_work_init(&gatt_sc.work, sc_process); -#endif /* CONFIG_BT_GATT_DB */ +#endif /* CONFIG_BT_GATT_DYNAMIC_DB */ #if defined(CONFIG_BT_SETTINGS_CCC_STORE_ON_WRITE) k_delayed_work_init(&gatt_ccc_store.work, ccc_delayed_store); #endif } -#if defined(CONFIG_BT_GATT_DB) +#if defined(CONFIG_BT_GATT_DYNAMIC_DB) static bool update_range(u16_t *start, u16_t *end, u16_t new_start, u16_t new_end) { @@ -825,7 +825,7 @@ int bt_gatt_service_unregister(struct bt_gatt_service *svc) return 0; } -#endif /* CONFIG_BT_GATT_DB */ +#endif /* CONFIG_BT_GATT_DYNAMIC_DB */ ssize_t bt_gatt_attr_read(struct bt_conn *conn, const struct bt_gatt_attr *attr, void *buf, u16_t buf_len, u16_t offset, @@ -1364,7 +1364,7 @@ static int gatt_indicate(struct bt_conn *conn, u16_t handle, return gatt_send(conn, buf, gatt_indicate_rsp, params, NULL); } -#if defined(CONFIG_BT_GATT_DB) +#if defined(CONFIG_BT_GATT_DYNAMIC_DB) struct sc_data { u16_t start; u16_t end; @@ -1397,7 +1397,7 @@ static void sc_save(struct bt_gatt_ccc_cfg *cfg, BT_DBG("peer %s start 0x%04x end 0x%04x", bt_addr_le_str(&cfg->peer), stored->start, stored->end); } -#endif /* CONFIG_BT_GATT_DB */ +#endif /* CONFIG_BT_GATT_DYNAMIC_DB */ static u8_t notify_cb(const struct bt_gatt_attr *attr, void *user_data) { @@ -1435,11 +1435,11 @@ static u8_t notify_cb(const struct bt_gatt_attr *attr, void *user_data) conn = bt_conn_lookup_addr_le(cfg->id, &cfg->peer); if (!conn) { -#if defined(CONFIG_BT_GATT_DB) +#if defined(CONFIG_BT_GATT_DYNAMIC_DB) if (ccc->cfg == sc_ccc_cfg) { sc_save(cfg, data->params); } -#endif /* CONFIG_BT_GATT_DB */ +#endif /* CONFIG_BT_GATT_DYNAMIC_DB */ continue; } @@ -1546,7 +1546,7 @@ u16_t bt_gatt_get_mtu(struct bt_conn *conn) return bt_att_get_mtu(conn); } -#if defined(CONFIG_BT_GATT_DB) +#if defined(CONFIG_BT_GATT_DYNAMIC_DB) static void sc_restore(struct bt_gatt_ccc_cfg *cfg) { struct sc_data *data = (struct sc_data *)cfg->data; @@ -1563,7 +1563,7 @@ static void sc_restore(struct bt_gatt_ccc_cfg *cfg) /* Reset config data */ (void)memset(cfg->data, 0, sizeof(cfg->data)); } -#endif /* CONFIG_BT_GATT_DB */ +#endif /* CONFIG_BT_GATT_DYNAMIC_DB */ static u8_t connected_cb(const struct bt_gatt_attr *attr, void *user_data) { @@ -1586,11 +1586,11 @@ static u8_t connected_cb(const struct bt_gatt_attr *attr, void *user_data) if (ccc->cfg[i].value) { gatt_ccc_changed(attr, ccc); -#if defined(CONFIG_BT_GATT_DB) +#if defined(CONFIG_BT_GATT_DYNAMIC_DB) if (ccc->cfg == sc_ccc_cfg) { sc_restore(&ccc->cfg[i]); } -#endif /* CONFIG_BT_GATT_DB */ +#endif /* CONFIG_BT_GATT_DYNAMIC_DB */ return BT_GATT_ITER_CONTINUE; } } diff --git a/subsys/bluetooth/host/mesh/Kconfig b/subsys/bluetooth/host/mesh/Kconfig index e941addcd3e582..4814a5704f5609 100644 --- a/subsys/bluetooth/host/mesh/Kconfig +++ b/subsys/bluetooth/host/mesh/Kconfig @@ -37,7 +37,7 @@ if BT_CONN # Virtual option enabled whenever any Proxy protocol is needed config BT_MESH_PROXY bool - select BT_GATT_DB + select BT_GATT_DYNAMIC_DB config BT_MESH_PB_GATT bool "Provisioning support using GATT (PB-GATT)" diff --git a/subsys/bluetooth/shell/gatt.c b/subsys/bluetooth/shell/gatt.c index 002b381ee3f06e..41c1d08619d58b 100644 --- a/subsys/bluetooth/shell/gatt.c +++ b/subsys/bluetooth/shell/gatt.c @@ -603,7 +603,7 @@ static int cmd_show_db(const struct shell *shell, size_t argc, char *argv[]) return 0; } -#if defined(CONFIG_BT_GATT_DB) +#if defined(CONFIG_BT_GATT_DYNAMIC_DB) /* Custom Service Variables */ static struct bt_uuid_128 vnd_uuid = BT_UUID_INIT_128( 0xf0, 0xde, 0xbc, 0x9a, 0x78, 0x56, 0x34, 0x12, @@ -873,7 +873,7 @@ static int cmd_metrics(const struct shell *shell, size_t argc, char *argv[]) return err; } -#endif /* CONFIG_BT_GATT_DB */ +#endif /* CONFIG_BT_GATT_DYNAMIC_DB */ static u8_t get_cb(const struct bt_gatt_attr *attr, void *user_data) { @@ -1004,7 +1004,7 @@ SHELL_STATIC_SUBCMD_SET_CREATE(gatt_cmds, SHELL_CMD_ARG(get, NULL, "", cmd_get, 2, 0), SHELL_CMD_ARG(set, NULL, " [data...]", cmd_set, 2, 255), SHELL_CMD_ARG(show-db, NULL, "[uuid]", cmd_show_db, 1, 1), -#if defined(CONFIG_BT_GATT_DB) +#if defined(CONFIG_BT_GATT_DYNAMIC_DB) SHELL_CMD_ARG(metrics, NULL, "register vendr char and measure rx ", cmd_metrics, 2, 0), @@ -1018,7 +1018,7 @@ SHELL_STATIC_SUBCMD_SET_CREATE(gatt_cmds, SHELL_CMD_ARG(unregister, NULL, "unregister pre-predefined test service", cmd_unregister_test_svc, 1, 0), -#endif /* CONFIG_BT_GATT_DB */ +#endif /* CONFIG_BT_GATT_DYNAMIC_DB */ SHELL_SUBCMD_SET_END ); diff --git a/subsys/mgmt/Kconfig b/subsys/mgmt/Kconfig index 96830b2e7ecee8..0d5bbb5c5a83c2 100644 --- a/subsys/mgmt/Kconfig +++ b/subsys/mgmt/Kconfig @@ -13,7 +13,7 @@ config MCUMGR_SMP_BT select MCUMGR select BT select BT_PERIPHERAL - select BT_GATT_DB + select BT_GATT_DYNAMIC_DB help Enables handling of SMP commands received over Bluetooth. diff --git a/tests/bluetooth/shell/prj.conf b/tests/bluetooth/shell/prj.conf index 61308f52552dc1..940b728cd2064b 100644 --- a/tests/bluetooth/shell/prj.conf +++ b/tests/bluetooth/shell/prj.conf @@ -20,7 +20,7 @@ CONFIG_BT_DEVICE_NAME="test shell" CONFIG_BT_DEVICE_NAME_DYNAMIC=y CONFIG_BT_L2CAP_TX_BUF_COUNT=4 CONFIG_BT_ID_MAX=2 -CONFIG_BT_GATT_DB=y +CONFIG_BT_GATT_DYNAMIC_DB=y CONFIG_BT_SETTINGS=y CONFIG_FLASH=y