nimble/controller: Fix for missing scansm pointer in connsm

This fix issue with creating legacy connection when BLE_EXT_ADV is on.

X-Original-Commit: 0faccea4d62ddbc7f72e4f72c58765cd40d04e5f
This commit is contained in:
Łukasz Rymanowski
2017-07-04 11:40:53 +02:00
parent a3d773119e
commit edd5d46b02
3 changed files with 21 additions and 4 deletions
@@ -169,7 +169,8 @@ int ble_ll_scan_whitelist_enabled(void);
/* Initialize the scanner when we start initiating */
struct hci_create_conn;
int ble_ll_scan_initiator_start(struct hci_create_conn *hcc);
int ble_ll_scan_initiator_start(struct hci_create_conn *hcc,
struct ble_ll_scan_sm **sm);
/* Returns the PDU allocated by the scanner */
struct os_mbuf *ble_ll_scan_get_pdu(void);
+1 -1
View File
@@ -506,7 +506,7 @@ ble_ll_conn_create(uint8_t *cmdbuf)
/* CSA will be selected when advertising is received */
/* Start scanning */
rc = ble_ll_scan_initiator_start(hcc);
rc = ble_ll_scan_initiator_start(hcc, &connsm->scansm);
if (rc) {
SLIST_REMOVE(&g_ble_ll_conn_active_list,connsm,ble_ll_conn_sm,act_sle);
STAILQ_INSERT_TAIL(&g_ble_ll_conn_free_list, connsm, free_stqe);
+18 -2
View File
@@ -2485,13 +2485,18 @@ ble_ll_scan_can_chg_whitelist(void)
}
int
ble_ll_scan_initiator_start(struct hci_create_conn *hcc)
ble_ll_scan_initiator_start(struct hci_create_conn *hcc,
struct ble_ll_scan_sm **sm)
{
struct ble_ll_scan_sm *scansm;
struct ble_ll_scan_params *scanphy;
int rc;
scansm = &g_ble_ll_scan_sm;
scansm->own_addr_type = hcc->own_addr_type;
scansm->ext_scanning = 0;
scansm->cur_phy = PHY_UNCODED;
scansm->next_phy = PHY_NOT_CONFIGURED;
scanphy = &scansm->phy_data[scansm->cur_phy];
scanphy->scan_filt_policy = hcc->filter_policy;
@@ -2499,7 +2504,18 @@ ble_ll_scan_initiator_start(struct hci_create_conn *hcc)
scanphy->scan_window = hcc->scan_window;
scanphy->scan_type = BLE_SCAN_TYPE_INITIATE;
return ble_ll_scan_sm_start(scansm);
rc = ble_ll_scan_sm_start(scansm);
if (sm == NULL) {
return rc;
}
if (rc == BLE_ERR_SUCCESS) {
*sm = scansm;
} else {
*sm = NULL;
}
return rc;
}
#if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_EXT_ADV)