Merge branch 'bugfix/btdm_ll_get_remote_feature' into 'master'
component/bt: Fix can't get remote's feature bug See merge request !871
This commit is contained in:
commit
ac5040a7c2
5 changed files with 25 additions and 8 deletions
|
@ -230,7 +230,10 @@ void btm_acl_created (BD_ADDR bda, DEV_CLASS dc, BD_NAME bdn,
|
||||||
p->link_role = link_role;
|
p->link_role = link_role;
|
||||||
p->link_up_issued = FALSE;
|
p->link_up_issued = FALSE;
|
||||||
memcpy (p->remote_addr, bda, BD_ADDR_LEN);
|
memcpy (p->remote_addr, bda, BD_ADDR_LEN);
|
||||||
|
/* Set the default version of the peer device to version4.0 before exchange the version with it.
|
||||||
|
If the peer device act as a master and don't exchange the version with us, then it can only use the
|
||||||
|
legacy connect instead of secure connection in the pairing step. */
|
||||||
|
p->lmp_version = HCI_PROTO_VERSION_4_0;
|
||||||
#if BLE_INCLUDED == TRUE
|
#if BLE_INCLUDED == TRUE
|
||||||
p->transport = transport;
|
p->transport = transport;
|
||||||
#if BLE_PRIVACY_SPT == TRUE
|
#if BLE_PRIVACY_SPT == TRUE
|
||||||
|
@ -308,11 +311,7 @@ void btm_acl_created (BD_ADDR bda, DEV_CLASS dc, BD_NAME bdn,
|
||||||
btsnd_hcic_ble_read_remote_feat(p->hci_handle);
|
btsnd_hcic_ble_read_remote_feat(p->hci_handle);
|
||||||
} else if (HCI_LE_SLAVE_INIT_FEAT_EXC_SUPPORTED(controller_get_interface()->get_features_ble()->as_array)
|
} else if (HCI_LE_SLAVE_INIT_FEAT_EXC_SUPPORTED(controller_get_interface()->get_features_ble()->as_array)
|
||||||
&& link_role == HCI_ROLE_SLAVE) {
|
&& link_role == HCI_ROLE_SLAVE) {
|
||||||
/* In the original Bluedroid version, slave need to send LL_SLAVE_FEATURE_REQ(call btsnd_hcic_ble_read_remote_feat)
|
btsnd_hcic_ble_read_remote_feat(p->hci_handle);
|
||||||
* to remote device if it has not received ll_feature_req.
|
|
||||||
* Delete it to resolve Android 7.0 incompatible problem. But it may cause that slave
|
|
||||||
* can't get remote device's feature if it doesn't receive ll_feature_req.*/
|
|
||||||
l2cble_notify_le_connection(bda);
|
|
||||||
} else {
|
} else {
|
||||||
btm_establish_continue(p);
|
btm_establish_continue(p);
|
||||||
}
|
}
|
||||||
|
|
|
@ -3315,7 +3315,21 @@ void btm_ble_read_remote_features_complete(UINT8 *p)
|
||||||
for (xx = 0; xx < MAX_L2CAP_LINKS; xx++, p_acl_cb++) {
|
for (xx = 0; xx < MAX_L2CAP_LINKS; xx++, p_acl_cb++) {
|
||||||
if ((p_acl_cb->in_use) && (p_acl_cb->hci_handle == handle)) {
|
if ((p_acl_cb->in_use) && (p_acl_cb->hci_handle == handle)) {
|
||||||
STREAM_TO_ARRAY(p_acl_cb->peer_le_features, p, BD_FEATURES_LEN);
|
STREAM_TO_ARRAY(p_acl_cb->peer_le_features, p, BD_FEATURES_LEN);
|
||||||
btsnd_hcic_rmt_ver_req (p_acl_cb->hci_handle);
|
#if BLE_INCLUDED == TRUE
|
||||||
|
/* In the original Bluedroid version, slave need to send LL_VERSION_IND(call btsnd_hcic_rmt_ver_req)
|
||||||
|
* to remote device if it has not received ll_version_ind.
|
||||||
|
* Delete it to resolve Android 7.0 incompatible problem. But it may cause that slave host
|
||||||
|
* can't get remote device's version.*/
|
||||||
|
if (p_acl_cb->link_role == HCI_ROLE_MASTER){
|
||||||
|
btsnd_hcic_rmt_ver_req (p_acl_cb->hci_handle);
|
||||||
|
}
|
||||||
|
|
||||||
|
else{
|
||||||
|
if (p_acl_cb->transport == BT_TRANSPORT_LE) {
|
||||||
|
l2cble_notify_le_connection (p_acl_cb->remote_addr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -473,6 +473,7 @@ static void btu_general_alarm_process(TIMER_LIST_ENT *p_tle)
|
||||||
case BTU_TTYPE_ATT_WAIT_FOR_IND_ACK:
|
case BTU_TTYPE_ATT_WAIT_FOR_IND_ACK:
|
||||||
gatt_ind_ack_timeout(p_tle);
|
gatt_ind_ack_timeout(p_tle);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#if (defined(SMP_INCLUDED) && SMP_INCLUDED == TRUE)
|
#if (defined(SMP_INCLUDED) && SMP_INCLUDED == TRUE)
|
||||||
case BTU_TTYPE_SMP_PAIRING_CMD:
|
case BTU_TTYPE_SMP_PAIRING_CMD:
|
||||||
smp_rsp_timeout(p_tle);
|
smp_rsp_timeout(p_tle);
|
||||||
|
@ -547,6 +548,7 @@ void btu_start_timer(TIMER_LIST_ENT *p_tle, UINT16 type, UINT32 timeout_sec)
|
||||||
osi_alarm_set(alarm, (period_ms_t)(timeout_sec * 1000));
|
osi_alarm_set(alarm, (period_ms_t)(timeout_sec * 1000));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
**
|
**
|
||||||
** Function btu_stop_timer
|
** Function btu_stop_timer
|
||||||
|
|
|
@ -163,6 +163,8 @@ typedef void (*tBTU_EVENT_CALLBACK)(BT_HDR *p_hdr);
|
||||||
|
|
||||||
#define BTU_TTYPE_UCD_TO 108
|
#define BTU_TTYPE_UCD_TO 108
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* This is the inquiry response information held by BTU, and available
|
/* This is the inquiry response information held by BTU, and available
|
||||||
** to applications.
|
** to applications.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -396,7 +396,7 @@ void app_main()
|
||||||
|
|
||||||
/* set the security iocap & auth_req & key size & init key response key parameters to the stack*/
|
/* set the security iocap & auth_req & key size & init key response key parameters to the stack*/
|
||||||
esp_ble_auth_req_t auth_req = ESP_LE_AUTH_BOND; //bonding with peer device after authentication
|
esp_ble_auth_req_t auth_req = ESP_LE_AUTH_BOND; //bonding with peer device after authentication
|
||||||
esp_ble_io_cap_t iocap = ESP_IO_CAP_OUT; //set the IO capability to Output only
|
esp_ble_io_cap_t iocap = ESP_IO_CAP_NONE; //set the IO capability to No output No input
|
||||||
uint8_t key_size = 16; //the key size should be 7~16 bytes
|
uint8_t key_size = 16; //the key size should be 7~16 bytes
|
||||||
uint8_t init_key = ESP_BLE_ENC_KEY_MASK | ESP_BLE_ID_KEY_MASK;
|
uint8_t init_key = ESP_BLE_ENC_KEY_MASK | ESP_BLE_ID_KEY_MASK;
|
||||||
uint8_t rsp_key = ESP_BLE_ENC_KEY_MASK | ESP_BLE_ID_KEY_MASK;
|
uint8_t rsp_key = ESP_BLE_ENC_KEY_MASK | ESP_BLE_ID_KEY_MASK;
|
||||||
|
|
Loading…
Reference in a new issue