From 184555d70bb335edbe8fe4feff9673d9f9659255 Mon Sep 17 00:00:00 2001 From: Sarvesh Bodakhe Date: Fri, 15 Mar 2024 12:12:12 +0530 Subject: [PATCH 1/3] fix(esp_wifi): Improvements in scan and connect path * Improvements in scan and connect path as per specifications along with minor bugfixes * When AP advertises all PSK modes (WPA, WPA2 and WPA3), make sure that station treats it as WPA2_WPA3_PSK mixed mode. --- components/esp_wifi/lib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/esp_wifi/lib b/components/esp_wifi/lib index 5cebf92b39..4cbb797214 160000 --- a/components/esp_wifi/lib +++ b/components/esp_wifi/lib @@ -1 +1 @@ -Subproject commit 5cebf92b398440266977440db81b0315831aeb41 +Subproject commit 4cbb797214650d5ff5e9854cfb4cc10e8c9bda4c From 57be8d2457f9f6decb32945f70811a87ad369a01 Mon Sep 17 00:00:00 2001 From: Li Shuai Date: Tue, 7 Nov 2023 21:30:51 +0800 Subject: [PATCH 2/3] fix(example): fixed app partition is too small for binary size --- examples/mesh/internal_communication/sdkconfig.defaults | 1 + examples/system/ota/advanced_https_ota/sdkconfig.ci.bluedroid | 1 + 2 files changed, 2 insertions(+) create mode 100644 examples/mesh/internal_communication/sdkconfig.defaults diff --git a/examples/mesh/internal_communication/sdkconfig.defaults b/examples/mesh/internal_communication/sdkconfig.defaults new file mode 100644 index 0000000000..4983b4dfe3 --- /dev/null +++ b/examples/mesh/internal_communication/sdkconfig.defaults @@ -0,0 +1 @@ +CONFIG_COMPILER_OPTIMIZATION_SIZE=y diff --git a/examples/system/ota/advanced_https_ota/sdkconfig.ci.bluedroid b/examples/system/ota/advanced_https_ota/sdkconfig.ci.bluedroid index de90100cf6..299f0544c1 100644 --- a/examples/system/ota/advanced_https_ota/sdkconfig.ci.bluedroid +++ b/examples/system/ota/advanced_https_ota/sdkconfig.ci.bluedroid @@ -7,6 +7,7 @@ CONFIG_CTRL_BTDM_MODEM_SLEEP=y CONFIG_BT_GATTS_SEND_SERVICE_CHANGE_MANUAL=y CONFIG_BT_BTU_TASK_STACK_SIZE=4512 CONFIG_BT_BLE_42_FEATURES_SUPPORTED=y +CONFIG_BT_STACK_NO_LOG=y # Partition Table CONFIG_PARTITION_TABLE_CUSTOM=y From ef4a5fda2dcba0935578fd4e6414b151dfc2a84e Mon Sep 17 00:00:00 2001 From: Alexey Lapshin Date: Wed, 19 Jul 2023 16:57:15 +0400 Subject: [PATCH 3/3] fix(bt): fix gcc 13.1.0 warnings --- .../bt/common/btc/profile/esp/blufi/blufi_prf.c | 4 ++-- .../api/core/esp_ble_mesh_provisioning_api.c | 17 ++++++++--------- .../bt/host/bluedroid/stack/btm/btm_ble_5_gap.c | 4 +++- .../bt/host/bluedroid/stack/btu/btu_hcif.c | 8 +------- 4 files changed, 14 insertions(+), 19 deletions(-) diff --git a/components/bt/common/btc/profile/esp/blufi/blufi_prf.c b/components/bt/common/btc/profile/esp/blufi/blufi_prf.c index 40b627c4d0..9620df5ce0 100644 --- a/components/bt/common/btc/profile/esp/blufi/blufi_prf.c +++ b/components/bt/common/btc/profile/esp/blufi/blufi_prf.c @@ -366,7 +366,7 @@ void btc_blufi_send_wifi_list(uint16_t apCount, esp_blufi_ap_record_t *list) int data_len; uint8_t *p; // malloc size: (len + RSSI + ssid buffer) * apCount; - uint malloc_size = (1 + 1 + sizeof(list->ssid)) * apCount; + uint32_t malloc_size = (1 + 1 + sizeof(list->ssid)) * apCount; p = data = osi_malloc(malloc_size); if (data == NULL) { BTC_TRACE_ERROR("malloc error\n"); @@ -375,7 +375,7 @@ void btc_blufi_send_wifi_list(uint16_t apCount, esp_blufi_ap_record_t *list) type = BLUFI_BUILD_TYPE(BLUFI_TYPE_DATA, BLUFI_TYPE_DATA_SUBTYPE_WIFI_LIST); for (int i = 0; i < apCount; ++i) { - uint len = strlen((const char *)list[i].ssid); + uint32_t len = strlen((const char *)list[i].ssid); data_len = (p - data); //current_len + ssid + rssi + total_len_value if((data_len + len + 1 + 1) > malloc_size) { diff --git a/components/bt/esp_ble_mesh/api/core/esp_ble_mesh_provisioning_api.c b/components/bt/esp_ble_mesh/api/core/esp_ble_mesh_provisioning_api.c index a2fcfd9c72..ff89fcd572 100644 --- a/components/bt/esp_ble_mesh/api/core/esp_ble_mesh_provisioning_api.c +++ b/components/bt/esp_ble_mesh/api/core/esp_ble_mesh_provisioning_api.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2017-2021 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2017-2024 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -139,9 +139,9 @@ esp_err_t esp_ble_mesh_node_input_string(const char *string) msg.sig = BTC_SIG_API_CALL; msg.pid = BTC_PID_PROV; msg.act = BTC_BLE_MESH_ACT_INPUT_STRING; - memset(arg.input_string.string, 0, sizeof(arg.input_string.string)); - strncpy(arg.input_string.string, string, - MIN(strlen(string), sizeof(arg.input_string.string))); + + arg.input_string.string[sizeof(arg.input_string.string) - 1] = 0; + strncpy(arg.input_string.string, string, sizeof(arg.input_string.string) - 1); return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL); @@ -162,8 +162,8 @@ esp_err_t esp_ble_mesh_set_unprovisioned_device_name(const char *name) msg.pid = BTC_PID_PROV; msg.act = BTC_BLE_MESH_ACT_SET_DEVICE_NAME; - memset(arg.set_device_name.name, 0, sizeof(arg.set_device_name.name)); - strncpy(arg.set_device_name.name, name, ESP_BLE_MESH_DEVICE_NAME_MAX_LEN); + arg.set_device_name.name[sizeof(arg.set_device_name.name) - 1] = 0; + strncpy(arg.set_device_name.name, name, sizeof(arg.set_device_name.name) - 1); return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL); @@ -210,9 +210,8 @@ esp_err_t esp_ble_mesh_provisioner_input_string(const char *string, uint8_t link msg.pid = BTC_PID_PROV; msg.act = BTC_BLE_MESH_ACT_PROVISIONER_INPUT_STR; - memset(arg.provisioner_input_str.string, 0, sizeof(arg.provisioner_input_str.string)); - strncpy(arg.provisioner_input_str.string, string, - MIN(strlen(string), sizeof(arg.provisioner_input_str.string))); + arg.provisioner_input_str.string[sizeof(arg.provisioner_input_str.string) - 1] = 0; + strncpy(arg.provisioner_input_str.string, string, sizeof(arg.provisioner_input_str.string) - 1); arg.provisioner_input_str.link_idx = link_idx; return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL) diff --git a/components/bt/host/bluedroid/stack/btm/btm_ble_5_gap.c b/components/bt/host/bluedroid/stack/btm/btm_ble_5_gap.c index f22229a821..04ad4804bd 100644 --- a/components/bt/host/bluedroid/stack/btm/btm_ble_5_gap.c +++ b/components/bt/host/bluedroid/stack/btm/btm_ble_5_gap.c @@ -37,7 +37,8 @@ typedef struct { tBTM_EXT_ADV_RECORD adv_record[MAX_BLE_ADV_INSTANCE] = {0}; extern void btm_ble_inter_set(bool extble_inter); -static char *btm_ble_hci_status_to_str(tHCI_STATUS status) +#if !UC_BT_STACK_NO_LOG +static const char *btm_ble_hci_status_to_str(tHCI_STATUS status) { switch(status) { case HCI_SUCCESS: @@ -186,6 +187,7 @@ static char *btm_ble_hci_status_to_str(tHCI_STATUS status) return NULL; } +#endif /* !UC_BT_STACK_NO_LOG */ void btm_ble_extendadvcb_init(void) { diff --git a/components/bt/host/bluedroid/stack/btu/btu_hcif.c b/components/bt/host/bluedroid/stack/btu/btu_hcif.c index 6b8dd882da..89b3ab50c6 100644 --- a/components/bt/host/bluedroid/stack/btu/btu_hcif.c +++ b/components/bt/host/bluedroid/stack/btu/btu_hcif.c @@ -949,6 +949,7 @@ static void btu_hcif_esco_connection_chg_evt (UINT8 *p) static void btu_hcif_hdl_command_complete (UINT16 opcode, UINT8 *p, UINT16 evt_len, void *p_cplt_cback) { + uint8_t status; switch (opcode) { case HCI_INQUIRY_CANCEL: /* Tell inquiry processing that we are done */ @@ -1011,7 +1012,6 @@ static void btu_hcif_hdl_command_complete (UINT16 opcode, UINT8 *p, UINT16 evt_l btm_ble_clear_white_list_complete(p, evt_len); break; case HCI_BLE_WRITE_ADV_PARAMS: { - uint8_t status; STREAM_TO_UINT8 (status, p); if(status != HCI_SUCCESS) { HCI_TRACE_ERROR("hci write adv params error 0x%x", status); @@ -1019,7 +1019,6 @@ static void btu_hcif_hdl_command_complete (UINT16 opcode, UINT8 *p, UINT16 evt_l break; } case HCI_BLE_RC_PARAM_REQ_REPLY: { - uint8_t status; STREAM_TO_UINT8 (status, p); if(status != HCI_SUCCESS) { HCI_TRACE_ERROR("hci connection params reply command error 0x%x", status); @@ -1027,7 +1026,6 @@ static void btu_hcif_hdl_command_complete (UINT16 opcode, UINT8 *p, UINT16 evt_l break; } case HCI_BLE_RC_PARAM_REQ_NEG_REPLY: { - uint8_t status; STREAM_TO_UINT8 (status, p); if(status != HCI_SUCCESS) { HCI_TRACE_ERROR("hci connection params neg reply command error %x", status); @@ -1100,13 +1098,11 @@ static void btu_hcif_hdl_command_complete (UINT16 opcode, UINT8 *p, UINT16 evt_l case HCI_BLE_SET_EXT_ADV_DATA: case HCI_BLE_SET_EXT_SCAN_RSP_DATA: case HCI_BLE_SET_EXT_ADV_ENABLE: { - uint8_t status; STREAM_TO_UINT8 (status, p); HCI_TRACE_EVENT("%s opcode 0x%x status 0x%x", __func__, opcode, status); break; } case HCI_BLE_READ_PHY: { - uint8_t status; uint16_t conn_handle; uint8_t tx_phy; uint8_t rx_phy; @@ -1129,7 +1125,6 @@ static void btu_hcif_hdl_command_complete (UINT16 opcode, UINT8 *p, UINT16 evt_l case HCI_BLE_PERIOD_ADV_SYNC_TRANS: case HCI_BLE_PERIOD_ADV_SET_INFO_TRANS: case HCI_BLE_SET_PAST_PARAMS: { - UINT8 status; UINT16 conn_handle; STREAM_TO_UINT8(status, p); STREAM_TO_UINT16(conn_handle, p); @@ -1143,7 +1138,6 @@ static void btu_hcif_hdl_command_complete (UINT16 opcode, UINT8 *p, UINT16 evt_l if ((opcode & HCI_GRP_VENDOR_SPECIFIC) == HCI_GRP_VENDOR_SPECIFIC) { btm_vsc_complete (p, opcode, evt_len, (tBTM_CMPL_CB *)p_cplt_cback); } - uint8_t status; STREAM_TO_UINT8 (status, p); if(status != HCI_SUCCESS) { HCI_TRACE_ERROR("CC evt: op=0x%x, status=0x%x", opcode, status);