mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Merge branch 'bugfix/add_authmode_wpa_wpa2_wpa3_psk_v5.1' into 'release/v5.1'
esp_wifi: Handle case when AP advertises WPA, WPA2 and WPA3 securities simultaneously and other bugfixes (Backport v5.1) See merge request espressif/esp-idf!29689
This commit is contained in:
commit
4bdbb79b34
@ -366,7 +366,7 @@ void btc_blufi_send_wifi_list(uint16_t apCount, esp_blufi_ap_record_t *list)
|
|||||||
int data_len;
|
int data_len;
|
||||||
uint8_t *p;
|
uint8_t *p;
|
||||||
// malloc size: (len + RSSI + ssid buffer) * apCount;
|
// 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);
|
p = data = osi_malloc(malloc_size);
|
||||||
if (data == NULL) {
|
if (data == NULL) {
|
||||||
BTC_TRACE_ERROR("malloc error\n");
|
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);
|
type = BLUFI_BUILD_TYPE(BLUFI_TYPE_DATA, BLUFI_TYPE_DATA_SUBTYPE_WIFI_LIST);
|
||||||
for (int i = 0; i < apCount; ++i)
|
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);
|
data_len = (p - data);
|
||||||
//current_len + ssid + rssi + total_len_value
|
//current_len + ssid + rssi + total_len_value
|
||||||
if((data_len + len + 1 + 1) > malloc_size) {
|
if((data_len + len + 1 + 1) > malloc_size) {
|
||||||
|
@ -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
|
* 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.sig = BTC_SIG_API_CALL;
|
||||||
msg.pid = BTC_PID_PROV;
|
msg.pid = BTC_PID_PROV;
|
||||||
msg.act = BTC_BLE_MESH_ACT_INPUT_STRING;
|
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,
|
arg.input_string.string[sizeof(arg.input_string.string) - 1] = 0;
|
||||||
MIN(strlen(string), sizeof(arg.input_string.string)));
|
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)
|
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
|
||||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
== 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.pid = BTC_PID_PROV;
|
||||||
msg.act = BTC_BLE_MESH_ACT_SET_DEVICE_NAME;
|
msg.act = BTC_BLE_MESH_ACT_SET_DEVICE_NAME;
|
||||||
|
|
||||||
memset(arg.set_device_name.name, 0, sizeof(arg.set_device_name.name));
|
arg.set_device_name.name[sizeof(arg.set_device_name.name) - 1] = 0;
|
||||||
strncpy(arg.set_device_name.name, name, ESP_BLE_MESH_DEVICE_NAME_MAX_LEN);
|
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)
|
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
|
||||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
== 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.pid = BTC_PID_PROV;
|
||||||
msg.act = BTC_BLE_MESH_ACT_PROVISIONER_INPUT_STR;
|
msg.act = BTC_BLE_MESH_ACT_PROVISIONER_INPUT_STR;
|
||||||
|
|
||||||
memset(arg.provisioner_input_str.string, 0, 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,
|
strncpy(arg.provisioner_input_str.string, string, sizeof(arg.provisioner_input_str.string) - 1);
|
||||||
MIN(strlen(string), sizeof(arg.provisioner_input_str.string)));
|
|
||||||
arg.provisioner_input_str.link_idx = link_idx;
|
arg.provisioner_input_str.link_idx = link_idx;
|
||||||
|
|
||||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
|
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
|
||||||
|
@ -37,7 +37,8 @@ typedef struct {
|
|||||||
tBTM_EXT_ADV_RECORD adv_record[MAX_BLE_ADV_INSTANCE] = {0};
|
tBTM_EXT_ADV_RECORD adv_record[MAX_BLE_ADV_INSTANCE] = {0};
|
||||||
extern void btm_ble_inter_set(bool extble_inter);
|
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) {
|
switch(status) {
|
||||||
case HCI_SUCCESS:
|
case HCI_SUCCESS:
|
||||||
@ -186,6 +187,7 @@ static char *btm_ble_hci_status_to_str(tHCI_STATUS status)
|
|||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
#endif /* !UC_BT_STACK_NO_LOG */
|
||||||
|
|
||||||
void btm_ble_extendadvcb_init(void)
|
void btm_ble_extendadvcb_init(void)
|
||||||
{
|
{
|
||||||
|
@ -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,
|
static void btu_hcif_hdl_command_complete (UINT16 opcode, UINT8 *p, UINT16 evt_len,
|
||||||
void *p_cplt_cback)
|
void *p_cplt_cback)
|
||||||
{
|
{
|
||||||
|
uint8_t status;
|
||||||
switch (opcode) {
|
switch (opcode) {
|
||||||
case HCI_INQUIRY_CANCEL:
|
case HCI_INQUIRY_CANCEL:
|
||||||
/* Tell inquiry processing that we are done */
|
/* 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);
|
btm_ble_clear_white_list_complete(p, evt_len);
|
||||||
break;
|
break;
|
||||||
case HCI_BLE_WRITE_ADV_PARAMS: {
|
case HCI_BLE_WRITE_ADV_PARAMS: {
|
||||||
uint8_t status;
|
|
||||||
STREAM_TO_UINT8 (status, p);
|
STREAM_TO_UINT8 (status, p);
|
||||||
if(status != HCI_SUCCESS) {
|
if(status != HCI_SUCCESS) {
|
||||||
HCI_TRACE_ERROR("hci write adv params error 0x%x", status);
|
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;
|
break;
|
||||||
}
|
}
|
||||||
case HCI_BLE_RC_PARAM_REQ_REPLY: {
|
case HCI_BLE_RC_PARAM_REQ_REPLY: {
|
||||||
uint8_t status;
|
|
||||||
STREAM_TO_UINT8 (status, p);
|
STREAM_TO_UINT8 (status, p);
|
||||||
if(status != HCI_SUCCESS) {
|
if(status != HCI_SUCCESS) {
|
||||||
HCI_TRACE_ERROR("hci connection params reply command error 0x%x", status);
|
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;
|
break;
|
||||||
}
|
}
|
||||||
case HCI_BLE_RC_PARAM_REQ_NEG_REPLY: {
|
case HCI_BLE_RC_PARAM_REQ_NEG_REPLY: {
|
||||||
uint8_t status;
|
|
||||||
STREAM_TO_UINT8 (status, p);
|
STREAM_TO_UINT8 (status, p);
|
||||||
if(status != HCI_SUCCESS) {
|
if(status != HCI_SUCCESS) {
|
||||||
HCI_TRACE_ERROR("hci connection params neg reply command error %x", status);
|
HCI_TRACE_ERROR("hci connection params neg reply command error %x", status);
|
||||||
@ -1095,13 +1093,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_ADV_DATA:
|
||||||
case HCI_BLE_SET_EXT_SCAN_RSP_DATA:
|
case HCI_BLE_SET_EXT_SCAN_RSP_DATA:
|
||||||
case HCI_BLE_SET_EXT_ADV_ENABLE: {
|
case HCI_BLE_SET_EXT_ADV_ENABLE: {
|
||||||
uint8_t status;
|
|
||||||
STREAM_TO_UINT8 (status, p);
|
STREAM_TO_UINT8 (status, p);
|
||||||
HCI_TRACE_EVENT("%s opcode 0x%x status 0x%x", __func__, opcode, status);
|
HCI_TRACE_EVENT("%s opcode 0x%x status 0x%x", __func__, opcode, status);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case HCI_BLE_READ_PHY: {
|
case HCI_BLE_READ_PHY: {
|
||||||
uint8_t status;
|
|
||||||
uint16_t conn_handle;
|
uint16_t conn_handle;
|
||||||
uint8_t tx_phy;
|
uint8_t tx_phy;
|
||||||
uint8_t rx_phy;
|
uint8_t rx_phy;
|
||||||
@ -1124,7 +1120,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_SYNC_TRANS:
|
||||||
case HCI_BLE_PERIOD_ADV_SET_INFO_TRANS:
|
case HCI_BLE_PERIOD_ADV_SET_INFO_TRANS:
|
||||||
case HCI_BLE_SET_PAST_PARAMS: {
|
case HCI_BLE_SET_PAST_PARAMS: {
|
||||||
UINT8 status;
|
|
||||||
UINT16 conn_handle;
|
UINT16 conn_handle;
|
||||||
STREAM_TO_UINT8(status, p);
|
STREAM_TO_UINT8(status, p);
|
||||||
STREAM_TO_UINT16(conn_handle, p);
|
STREAM_TO_UINT16(conn_handle, p);
|
||||||
@ -1139,7 +1134,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) {
|
if ((opcode & HCI_GRP_VENDOR_SPECIFIC) == HCI_GRP_VENDOR_SPECIFIC) {
|
||||||
btm_vsc_complete (p, opcode, evt_len, (tBTM_CMPL_CB *)p_cplt_cback);
|
btm_vsc_complete (p, opcode, evt_len, (tBTM_CMPL_CB *)p_cplt_cback);
|
||||||
}
|
}
|
||||||
uint8_t status;
|
|
||||||
STREAM_TO_UINT8 (status, p);
|
STREAM_TO_UINT8 (status, p);
|
||||||
if(status != HCI_SUCCESS) {
|
if(status != HCI_SUCCESS) {
|
||||||
HCI_TRACE_ERROR("CC evt: op=0x%x, status=0x%x", opcode, status);
|
HCI_TRACE_ERROR("CC evt: op=0x%x, status=0x%x", opcode, status);
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit ac36b61c8b4845c435fb7318ff7bc00bb0abc6a6
|
Subproject commit 775025e7d30632253f5ad81ad3cbf7ab16dc2d2a
|
1
examples/mesh/internal_communication/sdkconfig.defaults
Normal file
1
examples/mesh/internal_communication/sdkconfig.defaults
Normal file
@ -0,0 +1 @@
|
|||||||
|
CONFIG_COMPILER_OPTIMIZATION_SIZE=y
|
@ -7,6 +7,7 @@ CONFIG_CTRL_BTDM_MODEM_SLEEP=y
|
|||||||
CONFIG_BT_GATTS_SEND_SERVICE_CHANGE_MANUAL=y
|
CONFIG_BT_GATTS_SEND_SERVICE_CHANGE_MANUAL=y
|
||||||
CONFIG_BT_BTU_TASK_STACK_SIZE=4512
|
CONFIG_BT_BTU_TASK_STACK_SIZE=4512
|
||||||
CONFIG_BT_BLE_42_FEATURES_SUPPORTED=y
|
CONFIG_BT_BLE_42_FEATURES_SUPPORTED=y
|
||||||
|
CONFIG_BT_STACK_NO_LOG=y
|
||||||
|
|
||||||
# Partition Table
|
# Partition Table
|
||||||
CONFIG_PARTITION_TABLE_CUSTOM=y
|
CONFIG_PARTITION_TABLE_CUSTOM=y
|
||||||
|
Loading…
x
Reference in New Issue
Block a user