mirror of
https://github.com/espressif/esp-idf.git
synced 2026-04-27 19:13:21 +00:00
fix(nimble): Bugfixes for various issues
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2015-2026 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -331,7 +331,9 @@ esp_blufi_gap_event(struct ble_gap_event *event, void *arg)
|
||||
}
|
||||
if (event->connect.status != 0) {
|
||||
/* Connection failed; resume advertising. */
|
||||
((void(*)(void))arg)();
|
||||
if (arg != NULL) {
|
||||
((void(*)(void))arg)();
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
case BLE_GAP_EVENT_DISCONNECT:
|
||||
@@ -366,7 +368,9 @@ esp_blufi_gap_event(struct ble_gap_event *event, void *arg)
|
||||
case BLE_GAP_EVENT_ADV_COMPLETE:
|
||||
ESP_LOGI(TAG, "advertise complete; reason=%d",
|
||||
event->adv_complete.reason);
|
||||
((void(*)(void))arg)();
|
||||
if (arg != NULL) {
|
||||
((void(*)(void))arg)();
|
||||
}
|
||||
return 0;
|
||||
|
||||
case BLE_GAP_EVENT_SUBSCRIBE:
|
||||
|
||||
@@ -160,10 +160,11 @@ menu "Security (SMP)"
|
||||
default 0
|
||||
help
|
||||
LE Security Mode 1 Levels:
|
||||
1. No Security
|
||||
2. Unauthenticated pairing with encryption
|
||||
3. Authenticated pairing with encryption
|
||||
4. Authenticated LE Secure Connections pairing with encryption using a 128-bit strength encryption key.
|
||||
1(0). No Security
|
||||
2(1). Unauthenticated pairing with encryption
|
||||
3(2). Authenticated pairing with encryption
|
||||
4(3). Authenticated LE Secure Connections pairing with encryption using a
|
||||
128-bit strength encryption key.
|
||||
|
||||
config BT_NIMBLE_SM_SC_ONLY
|
||||
int "Enable Secure Connections Only Mode"
|
||||
@@ -736,7 +737,7 @@ menu "BLE 6.x Features"
|
||||
|
||||
if BT_NIMBLE_60_FEATURE_SUPPORT
|
||||
config BT_NIMBLE_CHANNEL_SOUNDING
|
||||
bool "ble channel souding feature"
|
||||
bool "ble channel sounding feature"
|
||||
default n
|
||||
help
|
||||
Used to enable/disable the channel sounding feature
|
||||
@@ -1186,7 +1187,7 @@ menu "Extra Features"
|
||||
depends on BT_NIMBLE_ENABLED && BT_NIMBLE_SECURITY_ENABLE
|
||||
help
|
||||
Enable support for user defined static passkey for SMP
|
||||
|
||||
|
||||
config BT_NIMBLE_DTM_MODE_TEST
|
||||
bool "Enable DTM related test procedure support"
|
||||
default y
|
||||
|
||||
@@ -191,7 +191,7 @@ static void ble_hci_rx_acl(uint8_t *data, uint16_t len)
|
||||
m = ble_transport_alloc_acl_from_ll();
|
||||
|
||||
if (!m) {
|
||||
if (retry_count % 5) {
|
||||
if (retry_count % 5 == 0) {
|
||||
esp_rom_printf("ACL buf alloc failed %d times\n", retry_count);
|
||||
esp_rom_printf("Free ACL mbufs: %d\n", os_msys_num_free());
|
||||
}
|
||||
|
||||
Submodule components/bt/host/nimble/nimble updated: d8e5977c04...8930f4a977
@@ -39,12 +39,15 @@ static inline const char *ble_svc_gap_device_name(void)
|
||||
|
||||
static inline int ble_svc_gap_device_appearance_set(uint16_t appearance)
|
||||
{
|
||||
(void)appearance;
|
||||
ESP_LOGE(BLE_SVC_GAP_TAG, "GAP service not enabled. Enable CONFIG_BT_NIMBLE_GAP_SERVICE to use this API.");
|
||||
return -1;
|
||||
}
|
||||
|
||||
static inline int ble_svc_gap_device_key_material_set(uint8_t *session_key, uint8_t *iv)
|
||||
{
|
||||
(void)session_key;
|
||||
(void)iv;
|
||||
ESP_LOGE(BLE_SVC_GAP_TAG, "GAP service not enabled. Enable CONFIG_BT_NIMBLE_GAP_SERVICE to use this API.");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -2158,7 +2158,7 @@
|
||||
#ifdef CONFIG_BT_NIMBLE_STATIC_PASSKEY
|
||||
#define MYNEWT_VAL_STATIC_PASSKEY CONFIG_BT_NIMBLE_STATIC_PASSKEY
|
||||
#else
|
||||
#define CONFIG_BT_NIMBLE_STATIC_PASSKEY (0)
|
||||
#define MYNEWT_VAL_STATIC_PASSKEY (0)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -2222,7 +2222,7 @@
|
||||
#ifdef CONFIG_BT_NIMBLE_EXTRA_ADV_FIELDS
|
||||
#define MYNEWT_VAL_BLE_EXTRA_ADV_FIELDS CONFIG_BT_NIMBLE_EXTRA_ADV_FIELDS
|
||||
#else
|
||||
#define CONFIG_BT_NIMBLE_EXTRA_ADV_FIELDS (0)
|
||||
#define MYNEWT_VAL_BLE_EXTRA_ADV_FIELDS (0)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -2242,14 +2242,6 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef MYNEWT_VAL_BLE_STATIC_TO_DYNAMIC
|
||||
#ifdef CONFIG_BT_NIMBLE_STATIC_TO_DYNAMIC
|
||||
#define MYNEWT_VAL_BLE_STATIC_TO_DYNAMIC CONFIG_BT_NIMBLE_STATIC_TO_DYNAMIC
|
||||
#else
|
||||
#define MYNEWT_VAL_BLE_STATIC_TO_DYNAMIC (0)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef MYNEWT_VAL_BLE_RESTART_PAIR
|
||||
#define MYNEWT_VAL_BLE_RESTART_PAIR (1)
|
||||
#endif
|
||||
|
||||
@@ -33,6 +33,9 @@ static esp_bd_addr_t s_cached_remote_bda = {0x0,};
|
||||
|
||||
uint8_t get_keep_ble_on()
|
||||
{
|
||||
if (g_ble_cfg_p == NULL) {
|
||||
return 0;
|
||||
}
|
||||
return g_ble_cfg_p->keep_ble_on;
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@ union ble_store_key;
|
||||
#define BLE_HCI_LE_CS_SUBEVENT_DONE_STATUS_ABORTED 0xF
|
||||
|
||||
#define LOCAL_PROCEDURE_MEM 1024 // Replace with an appropriate constant value
|
||||
struct ble_hs_cfg;
|
||||
struct ble_gatt_register_ctxt;
|
||||
|
||||
/** GATT server. */
|
||||
|
||||
@@ -520,7 +520,7 @@ ble_cts_cent_gap_event(struct ble_gap_event *event, void *arg)
|
||||
(event->cache_assoc.cache_state == 0) ? "INVALID" : "LOADED");
|
||||
/* Perform service discovery */
|
||||
rc = peer_disc_all(event->cache_assoc.conn_handle,
|
||||
blecent_on_disc_complete, NULL);
|
||||
ble_cts_cent_on_disc_complete, NULL);
|
||||
if(rc != 0) {
|
||||
MODLOG_DFLT(ERROR, "Failed to discover services; rc=%d\n", rc);
|
||||
return 0;
|
||||
|
||||
@@ -348,7 +348,7 @@ blecoex_gap_event(struct ble_gap_event *event, void *arg)
|
||||
|
||||
case BLE_GAP_EVENT_CONNECT:
|
||||
MODLOG_DFLT(INFO, "%s connection %s; status=%d ",
|
||||
client_connect == 1 ? "Client" : "Server",
|
||||
client_connect == 1 ? "Client" : "Server",
|
||||
event->connect.status == 0 ? "established" : "failed",
|
||||
event->connect.status);
|
||||
|
||||
|
||||
@@ -628,8 +628,8 @@ ble_htp_cent_gap_event(struct ble_gap_event *event, void *arg)
|
||||
event->cache_assoc.status,
|
||||
(event->cache_assoc.cache_state == 0) ? "INVALID" : "LOADED");
|
||||
/* Perform service discovery */
|
||||
rc = peer_disc_all(event->cache_assoc.conn_handle,
|
||||
blecent_on_disc_complete, NULL);
|
||||
rc = peer_disc_all(event->connect.conn_handle,
|
||||
ble_htp_cent_on_disc_complete, NULL);
|
||||
if(rc != 0) {
|
||||
MODLOG_DFLT(ERROR, "Failed to discover services; rc=%d\n", rc);
|
||||
return 0;
|
||||
|
||||
@@ -581,8 +581,8 @@ ble_prox_cent_gap_event(struct ble_gap_event *event, void *arg)
|
||||
event->cache_assoc.status,
|
||||
(event->cache_assoc.cache_state == 0) ? "INVALID" : "LOADED");
|
||||
/* Perform service discovery */
|
||||
rc = peer_disc_all(event->cache_assoc.conn_handle,
|
||||
blecent_on_disc_complete, NULL);
|
||||
rc = peer_disc_all(event->connect.conn_handle,
|
||||
ble_prox_cent_on_disc_complete, NULL);
|
||||
if(rc != 0) {
|
||||
MODLOG_DFLT(ERROR, "Failed to discover services; rc=%d\n", rc);
|
||||
return 0;
|
||||
|
||||
@@ -166,7 +166,7 @@ The following configuration flags can be adjusted to significantly reduce RAM us
|
||||
| CONFIG_COMPILER_OPTIMIZATION_SIZE | n → y | 8408 |
|
||||
| CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE | n → y | 5896 |
|
||||
| CONFIG_ESP_COEX_SW_COEXIST_ENABLE | y → n | 896 |
|
||||
| ESP_TASK_WDT_EN | y → n | 528 |
|
||||
| CONFIG_ESP_TASK_WDT_EN | y → n | 528 |
|
||||
| CONFIG_LOG_DEFAULT_LEVEL_NONE | n → y | 2592 |
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
@@ -104,7 +104,7 @@ Notification sent succesfully
|
||||
The following configuration flags can be adjusted to significantly reduce RAM usage in your ESP-IDF project while retaining basic BLE functionality.
|
||||
|
||||
| Config Option | Old → New Value | RAM Saved (Bytes) |
|
||||
|--------------------------------------------------|-----------------|--------------------|
|
||||
| -------------------------------------------------|---------------- | ------------------ |
|
||||
| CONFIG_BT_NIMBLE_SM_SC | y → n | 2016 |
|
||||
| CONFIG_BT_NIMBLE_LL_CFG_FEAT_LE_ENCRYPTION | y → n | 32 |
|
||||
| CONFIG_BT_NIMBLE_GATT_MAX_PROCS | 4 → 2 | 112 |
|
||||
|
||||
@@ -515,7 +515,7 @@ peer_inc_add(struct peer *peer, uint16_t svc_start_handle,
|
||||
}
|
||||
}
|
||||
|
||||
/* Including the services into inlucding list */
|
||||
/* Including the services into including list */
|
||||
|
||||
cur_svc = peer_svc_find_range(peer, gatt_incl_svc->handle);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user