From 4f2fc3d1037fbc18e06ec5a8f99fc553491deaee Mon Sep 17 00:00:00 2001 From: "Deomid \"rojer\" Ryabkov" Date: Sun, 27 Dec 2020 05:14:22 +0000 Subject: [PATCH] ESP32: Update to ESP-IDF 4.2 https://github.com/cesanta/mongoose-os/issues/565 --- mos_esp32.yml | 23 +++++++++++------------ src/esp32/esp32_bt_gap.c | 6 ++++++ src/esp32/esp32_bt_gattc.c | 6 ++++++ src/esp32/esp32_bt_gatts.c | 2 +- 4 files changed, 24 insertions(+), 13 deletions(-) diff --git a/mos_esp32.yml b/mos_esp32.yml index 776a16a..d824d49 100644 --- a/mos_esp32.yml +++ b/mos_esp32.yml @@ -1,20 +1,19 @@ build_vars: - ESP_IDF_EXTRA_COMPONENTS: "${build_vars.ESP_IDF_EXTRA_COMPONENTS} bt" + ESP_IDF_EXTRA_COMPONENTS: "${build_vars.ESP_IDF_EXTRA_COMPONENTS} bt esp_wifi wpa_supplicant" ESP_IDF_SDKCONFIG_OPTS: > ${build_vars.ESP_IDF_SDKCONFIG_OPTS} - CONFIG_BT_ENABLED=y - CONFIG_BLUEDROID_ENABLED=y - CONFIG_BTC_TASK_STACK_SIZE=6144 - CONFIG_BLUEDROID_MEM_DEBUG= - CONFIG_CLASSIC_BT_ENABLED= - CONFIG_BT_DRAM_RELEASE=y - CONFIG_GATTS_ENABLE=y - CONFIG_GATTC_ENABLE=y - CONFIG_BLE_SMP_ENABLE=y - CONFIG_BT_STACK_NO_LOG= CONFIG_BT_ACL_CONNECTIONS=4 + CONFIG_BT_BLE_DYNAMIC_ENV_MEMORY=y + CONFIG_BT_BLE_SMP_ENABLE=y + CONFIG_BT_BLUEDROID_ENABLED=y + CONFIG_BT_BTC_TASK_STACK_SIZE=6144 + CONFIG_BT_CLASSIC_ENABLED=n + CONFIG_BT_DRAM_RELEASE=y + CONFIG_BT_ENABLED=y + CONFIG_BT_GATTS_ENABLE=y + CONFIG_BT_GATTC_ENABLE=y CONFIG_BTDM_CONTROLLER_RUN_CPU=0 - CONFIG_SMP_ENABLE=y + CONFIG_BT_SMP_ENABLE=y CONFIG_BT_RESERVE_DRAM=0x10000 # Control verbose debugging for various BT modules. diff --git a/src/esp32/esp32_bt_gap.c b/src/esp32/esp32_bt_gap.c index 4b23dff..e854500 100644 --- a/src/esp32/esp32_bt_gap.c +++ b/src/esp32/esp32_bt_gap.c @@ -422,6 +422,12 @@ static void esp32_gap_ev_handler(esp_gap_ble_cb_event_t ev, p->status, p->subcode)); break; } + case ESP_GAP_BLE_SET_CHANNELS_EVT: { + const struct ble_set_channels_evt_param *p = &ep->ble_set_channels; + enum cs_log_level ll = ll_from_status(p->stat); + LOG(ll, ("SET_CHANNELS st %d", p->stat)); + break; + } case ESP_GAP_BLE_EVT_MAX: { break; } diff --git a/src/esp32/esp32_bt_gattc.c b/src/esp32/esp32_bt_gattc.c index 21e12c9..1ff5020 100644 --- a/src/esp32/esp32_bt_gattc.c +++ b/src/esp32/esp32_bt_gattc.c @@ -482,6 +482,12 @@ static void esp32_bt_gattc_ev(esp_gattc_cb_event_t ev, esp_gatt_if_t iface, LOG(ll, ("GET_ADDR_LIST st %d num_addr %u", p->status, p->num_addr)); break; } + case ESP_GATTC_DIS_SRVC_CMPL_EVT: { + const struct gattc_dis_srvc_cmpl_evt_param *p = &ep->dis_srvc_cmpl; + enum cs_log_level ll = ll_from_status(p->status); + LOG(ll, ("DIS_SRVC_CMPL st %d cid %u", p->status, p->conn_id)); + break; + } } } diff --git a/src/esp32/esp32_bt_gatts.c b/src/esp32/esp32_bt_gatts.c index 6ebcc38..df8ffbf 100644 --- a/src/esp32/esp32_bt_gatts.c +++ b/src/esp32/esp32_bt_gatts.c @@ -1156,7 +1156,7 @@ void mgos_bt_gatts_notify(struct mgos_bt_gatts_conn *gsc, if (gsc == NULL || mode == MGOS_BT_GATT_NOTIFY_MODE_OFF) return; struct esp32_bt_gatts_session_entry *sse = find_session(s_gatts_if, gsc->gc.conn_id, handle, NULL); - if (sse == NULL) return false; + if (sse == NULL) return; struct esp32_bt_gatts_pending_ind *pi = calloc(1, sizeof(*pi)); if (pi != NULL) { pi->handle = handle;