Merge branch 'bugfix/fix_esp32_bugs_230511' into 'release/v5.0'

Fixed some esp32 bugs(backport v5.0)

See merge request espressif/esp-idf!23704
This commit is contained in:
Jiang Jiang Jian 2023-05-15 13:40:05 +08:00
commit c21a4c9858
5 changed files with 23 additions and 9 deletions

@ -1 +1 @@
Subproject commit 8ce6d27e0981c09e1c5a982976f182d0a37662f6
Subproject commit 26b2361bf7569eb46b68eebdf9f634ef4ed17660

View File

@ -104,12 +104,13 @@ static void bas_gatts_callback(esp_gatts_evt_t event, tBTA_GATTS *p_data)
p_data->add_result.char_uuid.uu.uuid16);
UINT16 char_uuid = p_data->add_result.char_uuid.uu.uuid16;
UINT16 service_id = p_data->add_result.service_id;
if (char_uuid == GATT_UUID_BATTERY_LEVEL) {
bas_AddCharDescr(service_id, p_data->add_result.attr_id);
}
if (char_uuid == GATT_UUID_SYSTEM_ID | GATT_UUID_MODEL_NUMBER_STR | GATT_UUID_PNP_ID |
GATT_UUID_SERIAL_NUMBER_STR | GATT_UUID_FW_VERSION_STR | GATT_UUID_HW_VERSION_STR |
GATT_UUID_SW_VERSION_STR | GATT_UUID_MANU_NAME | GATT_UUID_IEEE_DATA) {
UINT16 uuid_len = p_data->add_result.char_uuid.len;
if (uuid_len == ESP_UUID_LEN_16) {
if (char_uuid == GATT_UUID_BATTERY_LEVEL) {
bas_AddCharDescr(service_id, p_data->add_result.attr_id);
}
switch (char_uuid) {
case GATT_UUID_SYSTEM_ID:
dis_cb.dis_attr[0].handle = service_id; break;
@ -130,6 +131,8 @@ static void bas_gatts_callback(esp_gatts_evt_t event, tBTA_GATTS *p_data)
case GATT_UUID_PNP_ID:
dis_cb.dis_attr[8].handle = service_id; break;
}
default:
break;
}
}
break;

View File

@ -1068,7 +1068,18 @@ uint32_t BTM_BleUpdateOwnType(uint8_t *own_bda_type, tBTM_START_ADV_CMPL_CBACK *
#else
uint32_t BTM_BleUpdateOwnType(uint8_t *own_bda_type, tBTM_START_ADV_CMPL_CBACK *cb)
{
if((*own_bda_type == BLE_ADDR_RANDOM) || (*own_bda_type == BLE_ADDR_RANDOM_ID)) {
if((btm_cb.ble_ctr_cb.addr_mgnt_cb.exist_addr_bit & BTM_BLE_GAP_ADDR_BIT_RANDOM) != BTM_BLE_GAP_ADDR_BIT_RANDOM) {
BTM_TRACE_ERROR("No random address yet, please set random address and try\n");
if(cb) {
(* cb)(HCI_ERR_ESP_VENDOR_FAIL);
}
return BTM_ILLEGAL_VALUE;
}
}
btm_cb.ble_ctr_cb.addr_mgnt_cb.own_addr_type = *own_bda_type;
return BTM_SUCCESS;
}
#endif

View File

@ -61,8 +61,8 @@ The Flow Chart of BluFi
Phone <- {IDF_TARGET_NAME} [label="Advertising"];
Phone -> {IDF_TARGET_NAME} [label="Create GATT connection"];
Phone <- {IDF_TARGET_NAME} [label="Negotiate key procedure"];
Phone -> {IDF_TARGET_NAME} [label="Negotiate key procedure"];
Phone <- {IDF_TARGET_NAME} [label="Negotiate key procedure"];
Phone -> {IDF_TARGET_NAME} [label="CTRL: Set {IDF_TARGET_NAME} to Phone Security mode"];
Phone -> {IDF_TARGET_NAME} [label="DATA: SSID"];
Phone -> {IDF_TARGET_NAME} [label="DATA: Password"];

View File

@ -61,8 +61,8 @@ BluFi 流程图
Phone <- {IDF_TARGET_NAME} [label="广播"];
Phone -> {IDF_TARGET_NAME} [label="建立 GATT 链接"];
Phone <- {IDF_TARGET_NAME} [label="协商密钥"];
Phone -> {IDF_TARGET_NAME} [label="协商密钥"];
Phone <- {IDF_TARGET_NAME} [label="协商密钥"];
Phone -> {IDF_TARGET_NAME} [label="CTRL: 设置 {IDF_TARGET_NAME} 为手机安全模式"];
Phone -> {IDF_TARGET_NAME} [label="DATA: SSID"];
Phone -> {IDF_TARGET_NAME} [label="DATA: Password"];