mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Merge branch 'bugfix/fix_some_ble_bugs_v5.1' into 'release/v5.1'
FIxed some BLE bugs (backport v5.1) See merge request espressif/esp-idf!24275
This commit is contained in:
commit
56bb50b85e
@ -1 +1 @@
|
||||
Subproject commit 26b2361bf7569eb46b68eebdf9f634ef4ed17660
|
||||
Subproject commit 7c757d49c407e31c50d17c0d917c65c95fe3b6cc
|
@ -1 +1 @@
|
||||
Subproject commit d7513ebe88d7d207f6c062ce9381d347a0a70918
|
||||
Subproject commit 08e289633f823191a6c526377bfd68f31fb392e0
|
@ -35,11 +35,35 @@
|
||||
#if (BLE_INCLUDED == TRUE)
|
||||
|
||||
#if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
const tHCI_ExtConnParams ext_conn_params = {
|
||||
#define EXT_CONN_INT_DEF_1M MAX(((MAX_ACL_CONNECTIONS + 1) * 4), 12)
|
||||
#define EXT_CONN_INT_DEF_2M MAX(((MAX_ACL_CONNECTIONS + 1) * 2), 12)
|
||||
#define EXT_CONN_INT_DEF_CODED (320) // 306-> 362Kbps
|
||||
|
||||
const static tHCI_ExtConnParams ext_conn_params_1m_phy = {
|
||||
.scan_interval = 0x40,
|
||||
.scan_window = 0x40,
|
||||
.conn_interval_min = 320, // 306-> 362Kbps
|
||||
.conn_interval_max = 320,
|
||||
.conn_interval_min = EXT_CONN_INT_DEF_1M,
|
||||
.conn_interval_max = EXT_CONN_INT_DEF_1M,
|
||||
.conn_latency = 0,
|
||||
.sup_timeout = 600,
|
||||
.min_ce_len = 0,
|
||||
.max_ce_len = 0,
|
||||
};
|
||||
const static tHCI_ExtConnParams ext_conn_params_2m_phy = {
|
||||
.scan_interval = 0x40,
|
||||
.scan_window = 0x40,
|
||||
.conn_interval_min = EXT_CONN_INT_DEF_2M,
|
||||
.conn_interval_max = EXT_CONN_INT_DEF_2M,
|
||||
.conn_latency = 0,
|
||||
.sup_timeout = 600,
|
||||
.min_ce_len = 0,
|
||||
.max_ce_len = 0,
|
||||
};
|
||||
const static tHCI_ExtConnParams ext_conn_params_coded_phy = {
|
||||
.scan_interval = 0x40,
|
||||
.scan_window = 0x40,
|
||||
.conn_interval_min = EXT_CONN_INT_DEF_CODED,
|
||||
.conn_interval_max = EXT_CONN_INT_DEF_CODED,
|
||||
.conn_latency = 0,
|
||||
.sup_timeout = 600,
|
||||
.min_ce_len = 0,
|
||||
@ -992,9 +1016,9 @@ BOOLEAN l2cble_init_direct_conn (tL2C_LCB *p_lcb)
|
||||
if (p_dev_rec->ext_conn_params.phy_mask == BLE_PHY_NO_PREF) {
|
||||
L2CAP_TRACE_WARNING("No extend connection parameters set, use default parameters");
|
||||
aux_conn.init_phy_mask = BLE_PHY_PREF_MASK;
|
||||
memcpy(&aux_conn.params[0], &ext_conn_params, sizeof(tHCI_ExtConnParams));
|
||||
memcpy(&aux_conn.params[1], &ext_conn_params, sizeof(tHCI_ExtConnParams));
|
||||
memcpy(&aux_conn.params[2], &ext_conn_params, sizeof(tHCI_ExtConnParams));
|
||||
memcpy(&aux_conn.params[0], &ext_conn_params_1m_phy, sizeof(tHCI_ExtConnParams));
|
||||
memcpy(&aux_conn.params[1], &ext_conn_params_2m_phy, sizeof(tHCI_ExtConnParams));
|
||||
memcpy(&aux_conn.params[2], &ext_conn_params_coded_phy, sizeof(tHCI_ExtConnParams));
|
||||
} else {
|
||||
aux_conn.init_phy_mask = p_dev_rec->ext_conn_params.phy_mask;
|
||||
memcpy(&aux_conn.params[0], &p_dev_rec->ext_conn_params.phy_1m_conn_params, sizeof(tHCI_ExtConnParams));
|
||||
|
@ -832,12 +832,14 @@ static esp_err_t esp_ble_hidd_dev_battery_set(void *devp, uint8_t level)
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
ret = esp_ble_gatts_send_indicate(dev->bat_svc.gatt_if, dev->conn_id, dev->bat_level_handle, 1, &dev->bat_level, dev->bat_ccc.indicate_enable);
|
||||
if (ret) {
|
||||
ESP_LOGE(TAG, "esp_ble_gatts_send_indicate failed: %d", ret);
|
||||
return ESP_FAIL;
|
||||
if (dev->bat_ccc.notify_enable) {
|
||||
ret = esp_ble_gatts_send_indicate(dev->bat_svc.gatt_if, dev->conn_id, dev->bat_level_handle, 1, &dev->bat_level, false);
|
||||
if (ret) {
|
||||
ESP_LOGE(TAG, "esp_ble_gatts_send_notify failed: %d", ret);
|
||||
return ESP_FAIL;
|
||||
}
|
||||
}
|
||||
WAIT_CB(dev);
|
||||
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user