mist90 opened a new issue, #2129:
URL: https://github.com/apache/mynewt-nimble/issues/2129
I use aic8800 bluetooth adapter with Nimble (Linux port). I got problem on
this hardware with BLE_EXT_ADV option: when a client connects to my server
under Nimble the server doesn't get BLE_GAP_EVENT_CONNECT event. Next I found
that server gets ATT message but drops it because connection is not
estableshed. I found that ble_gap_rx_conn_complete may not call in
ble_hs_hci_evt.c file in ble_hs_hci_evt_le_conn_complete and
ble_hs_hci_evt_le_enh_conn_complete functions:
`#if MYNEWT_VAL(BLE_EXT_ADV)
if (evt.status == BLE_ERR_DIR_ADV_TMO ||
evt.role == BLE_HCI_LE_CONN_COMPLETE_ROLE_SLAVE)
{
/* store this until we get set terminated event with adv handle */
memcpy(&pend_conn_complete, &evt, sizeof(evt));
return 0;
}
#endif
return ble_gap_rx_conn_complete(&evt, 0);
`
As I understand Nimble wait for stopping of advertising but on this adapter
this event doesn't receive or receives after ATT message.
Next I tried to fix file this manner:
` if (evt.status == BLE_ERR_DIR_ADV_TMO ||
evt.role == BLE_HCI_LE_CONN_COMPLETE_ROLE_SLAVE)
{
memcpy(&pend_conn_complete, &evt, sizeof(evt));
if (evt.role == BLE_HCI_LE_CONN_COMPLETE_ROLE_SLAVE) {
printf("ble_hs_hci_evt_le_enh_conn_complete: SLAVE role,
registering connection immediately\n");
/* Fall through to register connection immediately */
} else {
/* DIR_ADV_TMO case - wait for ADV_SET_TERMINATED */
return 0;
}
`
and this solved my problem.
I don't know much about Nimble code, but maybe this is a bug?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]