diff --git a/components/bt/CMakeLists.txt b/components/bt/CMakeLists.txt index 69a0d13ec0..d32a6d372c 100644 --- a/components/bt/CMakeLists.txt +++ b/components/bt/CMakeLists.txt @@ -712,7 +712,6 @@ if(CONFIG_BT_ENABLED) "host/nimble/nimble/nimble/host/store/config/src/ble_store_nvs.c" "host/nimble/nimble/nimble/host/src/ble_gattc_cache.c" "host/nimble/nimble/nimble/host/src/ble_gattc_cache_conn.c" - "host/nimble/nimble/nimble/host/src/ble_eatt.c" ) if(CONFIG_BT_CONTROLLER_DISABLED AND CONFIG_BT_NIMBLE_TRANSPORT_UART) diff --git a/components/bt/host/nimble/Kconfig.in b/components/bt/host/nimble/Kconfig.in index 598b67aa1c..d02293a87a 100644 --- a/components/bt/host/nimble/Kconfig.in +++ b/components/bt/host/nimble/Kconfig.in @@ -1048,10 +1048,3 @@ menu "Host-controller Transport" help UART HCI CTS pin endmenu - -config BT_NIMBLE_EATT_CHAN_NUM - int "Maximum number of EATT channels" - default 0 - depends on BT_NIMBLE_ENABLED - help - Defines the number of channels EATT bearers can use diff --git a/components/bt/host/nimble/nimble b/components/bt/host/nimble/nimble index a147a4ec7b..74c95610a2 160000 --- a/components/bt/host/nimble/nimble +++ b/components/bt/host/nimble/nimble @@ -1 +1 @@ -Subproject commit a147a4ec7bb36f9b90aa5b0679420e8c06037323 +Subproject commit 74c95610a2e45404fda46774abe6e6e70c40f1b2 diff --git a/components/bt/host/nimble/port/include/esp_nimble_cfg.h b/components/bt/host/nimble/port/include/esp_nimble_cfg.h index c37c5a91a9..d2fa333886 100644 --- a/components/bt/host/nimble/port/include/esp_nimble_cfg.h +++ b/components/bt/host/nimble/port/include/esp_nimble_cfg.h @@ -543,10 +543,6 @@ #define MYNEWT_VAL_BLE_ATT_SVR_NOTIFY (1) #endif -#ifndef MYNEWT_VAL_BLE_ATT_SVR_NOTIFY_MULTI -#define MYNEWT_VAL_BLE_ATT_SVR_NOTIFY_MULTI (1) -#endif - #ifndef MYNEWT_VAL_BLE_ATT_SVR_QUEUED_WRITE #define MYNEWT_VAL_BLE_ATT_SVR_QUEUED_WRITE (1) #endif @@ -571,10 +567,6 @@ #define MYNEWT_VAL_BLE_ATT_SVR_READ_MULT (1) #endif -#ifndef MYNEWT_VAL_BLE_ATT_SVR_READ_MULT_VAR -#define MYNEWT_VAL_BLE_ATT_SVR_READ_MULT_VAR (1) -#endif - #ifndef MYNEWT_VAL_BLE_ATT_SVR_READ_TYPE #define MYNEWT_VAL_BLE_ATT_SVR_READ_TYPE (1) #endif @@ -591,40 +583,6 @@ #define MYNEWT_VAL_BLE_ATT_SVR_WRITE_NO_RSP (1) #endif -#ifndef MYNEWT_VAL_BLE_EATT_CHAN_NUM -#define MYNEWT_VAL_BLE_EATT_CHAN_NUM (CONFIG_BT_NIMBLE_EATT_CHAN_NUM) -#endif - -#ifndef MYNEWT_VAL_BLE_EATT_LOG_LVL -#define MYNEWT_VAL_BLE_EATT_LOG_LVL (1) -#endif - -#ifndef MYNEWT_VAL_BLE_EATT_LOG_MOD -#define MYNEWT_VAL_BLE_EATT_LOG_MOD (27) -#endif - -#ifndef MYNEWT_VAL_BLE_EATT_MTU -#define MYNEWT_VAL_BLE_EATT_MTU (128) -#endif - -#ifndef MYNEWT_VAL_BLE_CLIENT_SUPPORTED_FEATURES -#if CONFIG_BT_NIMBLE_EATT_CHAN_NUM -#define MYNEWT_VAL_BLE_CLIENT_SUPPORTED_FEATURES_EATT (2) -#else -#define MYNEWT_VAL_BLE_CLIENT_SUPPORTED_FEATURES_EATT (0) -#endif //CONFIG_BT_NIMBLE_EATT_CHAN_NUM - -#if MYNEWT_VAL_BLE_ATT_SVR_NOTIFY_MULTI -#define MYNEWT_VAL_BLE_CLIENT_SUPPORTED_FEATURES_NOTIFY_MULTI (4) -#else -#define MYNEWT_VAL_BLE_CLIENT_SUPPORTED_FEATURES_NOTIFY_MULTI (0) -#endif //MYNEWT_VAL_BLE_ATT_SVR_NOTIFY_MULTI -#define MYNEWT_VAL_BLE_CLIENT_SUPPORTED_FEATURES ( \ - MYNEWT_VAL_BLE_CLIENT_SUPPORTED_FEATURES_EATT | \ - MYNEWT_VAL_BLE_CLIENT_SUPPORTED_FEATURES_NOTIFY_MULTI \ - ) -#endif //MYNEWT_VAL_CLIENT_SUPPORTED_FEATURES - #ifndef MYNEWT_VAL_BLE_GAP_MAX_PENDING_CONN_PARAM_UPDATE #define MYNEWT_VAL_BLE_GAP_MAX_PENDING_CONN_PARAM_UPDATE (1) #endif @@ -665,10 +623,6 @@ #define MYNEWT_VAL_BLE_GATT_NOTIFY (1) #endif -#ifndef MYNEWT_VAL_BLE_GATT_MULTI_NOTIFY -#define MYNEWT_VAL_BLE_GATT_MULTI_NOTIFY (1) -#endif - #ifndef MYNEWT_VAL_BLE_GATT_READ #define MYNEWT_VAL_BLE_GATT_READ (MYNEWT_VAL_BLE_ROLE_CENTRAL) #endif @@ -795,26 +749,16 @@ #define MYNEWT_VAL_BLE_HS_SYSINIT_STAGE (200) #endif -#if CONFIG_BT_NIMBLE_EATT_CHAN_NUM -#define MYNEWT_VAL_BLE_L2CAP_COC_MAX_NUM (CONFIG_BT_NIMBLE_EATT_CHAN_NUM) -#else #ifndef CONFIG_BT_NIMBLE_L2CAP_COC_MAX_NUM #define MYNEWT_VAL_BLE_L2CAP_COC_MAX_NUM (2) #else #define MYNEWT_VAL_BLE_L2CAP_COC_MAX_NUM CONFIG_BT_NIMBLE_L2CAP_COC_MAX_NUM -#endif //CONFIG_BT_NIMBLE_L2CAP_COC_MAX_NUM -#endif //CONFIG_BT_NIMBLE_EATT_CHAN_NUM +#endif #ifndef MYNEWT_VAL_BLE_L2CAP_COC_MPS #define MYNEWT_VAL_BLE_L2CAP_COC_MPS (MYNEWT_VAL_MSYS_1_BLOCK_SIZE-8) #endif -#if CONFIG_BT_NIMBLE_EATT_CHAN_NUM -#define MYNEWT_VAL_BLE_L2CAP_ENHANCED_COC (1) -#else -#define MYNEWT_VAL_BLE_L2CAP_ENHANCED_COC (0) -#endif - #ifndef MYNEWT_VAL_BLE_L2CAP_JOIN_RX_FRAGS #define MYNEWT_VAL_BLE_L2CAP_JOIN_RX_FRAGS (1) #endif @@ -828,12 +772,8 @@ #endif #ifndef MYNEWT_VAL_BLE_L2CAP_SIG_MAX_PROCS -#ifdef CONFIG_BT_NIMBLE_EATT_CHAN_NUM -#define MYNEWT_VAL_BLE_L2CAP_SIG_MAX_PROCS (CONFIG_BT_NIMBLE_EATT_CHAN_NUM) -#else #define MYNEWT_VAL_BLE_L2CAP_SIG_MAX_PROCS (1) #endif -#endif #ifndef MYNEWT_VAL_BLE_MESH #ifdef CONFIG_BT_NIMBLE_MESH diff --git a/components/bt/porting/nimble/include/nimble/nimble_opt_auto.h b/components/bt/porting/nimble/include/nimble/nimble_opt_auto.h index 7974fb231b..c4baec843b 100644 --- a/components/bt/porting/nimble/include/nimble/nimble_opt_auto.h +++ b/components/bt/porting/nimble/include/nimble/nimble_opt_auto.h @@ -120,10 +120,6 @@ extern "C" { #define NIMBLE_BLE_ATT_CLT_INDICATE \ (MYNEWT_VAL(BLE_GATT_INDICATE)) -#undef NIMBLE_BLE_ATT_CLT_MULTI_NOTIFY -#define NIMBLE_BLE_ATT_CLT_MULTI_NOTIFY \ - (MYNEWT_VAL(BLE_GATT_MULTI_NOTIFY)) - /** Security manager settings. */ #undef NIMBLE_BLE_SM diff --git a/examples/bluetooth/nimble/blecent/main/main.c b/examples/bluetooth/nimble/blecent/main/main.c index adfde26b01..078f50d0b0 100644 --- a/examples/bluetooth/nimble/blecent/main/main.c +++ b/examples/bluetooth/nimble/blecent/main/main.c @@ -62,11 +62,6 @@ static const char *tag = "NimBLE_BLE_CENT"; static int blecent_gap_event(struct ble_gap_event *event, void *arg); static uint8_t peer_addr[6]; -#if MYNEWT_VAL(BLE_EATT_CHAN_NUM) -static uint16_t cids[MYNEWT_VAL(BLE_EATT_CHAN_NUM)]; -static uint16_t bearers; -#endif - void ble_store_config_init(void); /** @@ -778,14 +773,6 @@ blecent_gap_event(struct ble_gap_event *event, void *arg) /* Forget about peer. */ peer_delete(event->disconnect.conn.conn_handle); -#if MYNEWT_VAL(BLE_EATT_CHAN_NUM) - /* Reset EATT config */ - bearers = 0; - for (int i = 0; i < MYNEWT_VAL(BLE_EATT_CHAN_NUM); i++) { - cids[i] = 0; - } -#endif - /* Resume scanning. */ blecent_scan(); return 0; @@ -802,16 +789,14 @@ blecent_gap_event(struct ble_gap_event *event, void *arg) rc = ble_gap_conn_find(event->enc_change.conn_handle, &desc); assert(rc == 0); print_conn_desc(&desc); -#if !MYNEWT_VAL(BLE_EATT_CHAN_NUM) #if CONFIG_EXAMPLE_ENCRYPTION /*** Go for service discovery after encryption has been successfully enabled ***/ - rc = peer_disc_all(event->enc_change.conn_handle, + rc = peer_disc_all(event->connect.conn_handle, blecent_on_disc_complete, NULL); if (rc != 0) { MODLOG_DFLT(ERROR, "Failed to discover services; rc=%d\n", rc); return 0; } -#endif #endif return 0; @@ -883,52 +868,6 @@ blecent_gap_event(struct ble_gap_event *event, void *arg) event->pathloss_threshold.zone_entered); return 0; #endif - -#if MYNEWT_VAL(BLE_EATT_CHAN_NUM) - case BLE_GAP_EVENT_EATT: - int i; - MODLOG_DFLT(INFO, "EATT %s : conn_handle=%d cid=%d", - event->eatt.status ? "disconnected" : "connected", - event->eatt.conn_handle, - event->eatt.cid); - if (event->eatt.status) { - /* Remove CID from the list of saved CIDs */ - for (i = 0; i < bearers; i++) { - if (cids[i] == event->eatt.cid) { - break; - } - } - while (i < (bearers - 1)) { - cids[i] = cids[i + 1]; - i += 1; - } - cids[i] = 0; - - /* Now Abort */ - return 0; - } - cids[bearers] = event->eatt.cid; - bearers += 1; - if (bearers != MYNEWT_VAL(BLE_EATT_CHAN_NUM)) { - /* Wait until all EATT bearers are connected before proceeding */ - return 0; - } - /* Set the default bearer to use for further procedures */ - rc = ble_att_set_default_bearer_using_cid(event->eatt.conn_handle, cids[0]); - if (rc != 0) { - MODLOG_DFLT(INFO, "Cannot set default EATT bearer, rc = %d\n", rc); - return rc; - } - - /* Perform service discovery */ - rc = peer_disc_all(event->eatt.conn_handle, - blecent_on_disc_complete, NULL); - if(rc != 0) { - MODLOG_DFLT(ERROR, "Failed to discover services; rc=%d\n", rc); - return 0; - } -#endif - return 0; default: return 0; } @@ -949,7 +888,6 @@ blecent_on_sync(void) rc = ble_hs_util_ensure_addr(0); assert(rc == 0); - #if !CONFIG_EXAMPLE_INIT_DEINIT_LOOP /* Begin scanning for a peripheral to connect to. */ blecent_scan(); @@ -1041,11 +979,4 @@ app_main(void) stack_init_deinit(); #endif -#if MYNEWT_VAL(BLE_EATT_CHAN_NUM) - bearers = 0; - for (int i = 0; i < MYNEWT_VAL(BLE_EATT_CHAN_NUM); i++) { - cids[i] = 0; - } -#endif - } diff --git a/examples/bluetooth/nimble/bleprph/main/main.c b/examples/bluetooth/nimble/bleprph/main/main.c index 838581c320..d86364c41c 100644 --- a/examples/bluetooth/nimble/bleprph/main/main.c +++ b/examples/bluetooth/nimble/bleprph/main/main.c @@ -45,11 +45,6 @@ static uint8_t own_addr_type = BLE_OWN_ADDR_RANDOM; static uint8_t own_addr_type; #endif -#if MYNEWT_VAL(BLE_EATT_CHAN_NUM) -static uint16_t cids[MYNEWT_VAL(BLE_EATT_CHAN_NUM)]; -static uint16_t bearers; -#endif - void ble_store_config_init(void); /** @@ -421,37 +416,13 @@ bleprph_gap_event(struct ble_gap_event *event, void *arg) event->transmit_power.delta); return 0; - case BLE_GAP_EVENT_PATHLOSS_THRESHOLD: + case BLE_GAP_EVENT_PATHLOSS_THRESHOLD: MODLOG_DFLT(INFO, "Pathloss threshold event : conn_handle=%d current path loss=%d " "zone_entered =%d", event->pathloss_threshold.conn_handle, event->pathloss_threshold.current_path_loss, event->pathloss_threshold.zone_entered); return 0; -#endif -#if MYNEWT_VAL(BLE_EATT_CHAN_NUM) - case BLE_GAP_EVENT_EATT: - MODLOG_DFLT(INFO, "EATT %s : conn_handle=%d cid=%d", - event->eatt.status ? "disconnected" : "connected", - event->eatt.conn_handle, - event->eatt.cid); - if (event->eatt.status) { - /* Abort if disconnected */ - return 0; - } - cids[bearers] = event->eatt.cid; - bearers += 1; - if (bearers != MYNEWT_VAL(BLE_EATT_CHAN_NUM)) { - /* Wait until all EATT bearers are connected before proceeding */ - return 0; - } - /* Set the default bearer to use for further procedures */ - rc = ble_att_set_default_bearer_using_cid(event->eatt.conn_handle, cids[0]); - if (rc != 0) { - MODLOG_DFLT(INFO, "Cannot set default EATT bearer, rc = %d\n", rc); - return rc; - } - return 0; #endif } @@ -595,11 +566,4 @@ app_main(void) if (rc != ESP_OK) { ESP_LOGE(tag, "scli_init() failed"); } - -#if MYNEWT_VAL(BLE_EATT_CHAN_NUM) - bearers = 0; - for (int i = 0; i < MYNEWT_VAL(BLE_EATT_CHAN_NUM); i++) { - cids[i] = 0; - } -#endif }