sjanc commented on a change in pull request #639: nimble/ll: Fix extended
scanner data fragmentation issues
URL: https://github.com/apache/mynewt-nimble/pull/639#discussion_r343335594
##########
File path: nimble/controller/src/ble_ll_scan.c
##########
@@ -2707,42 +2706,35 @@ ble_ll_hci_send_ext_adv_report(uint8_t ptype, uint8_t
*adva, uint8_t adva_type,
hci_ev_next = ble_ll_scan_get_ext_adv_report(report);
if (hci_ev_next) {
- report->evt_type |= (BLE_HCI_ADV_DATA_STATUS_INCOMPLETE);
+ report->evt_type |= BLE_HCI_ADV_DATA_STATUS_INCOMPLETE;
+ rc = 1;
} else {
- report->evt_type |= (BLE_HCI_ADV_DATA_STATUS_TRUNCATED);
+ report->evt_type |= BLE_HCI_ADV_DATA_STATUS_TRUNCATED;
rc = -1;
- if (aux_data) {
- BLE_LL_AUX_SET_FLAG(aux_data, BLE_LL_AUX_TRUNCATED_SENT);
- if (!BLE_LL_AUX_CHECK_FLAG(aux_data,
BLE_LL_SENT_EVENT_TO_HOST)) {
- ble_hci_trans_buf_free((uint8_t *)hci_ev);
- goto done;
- }
- }
-
- }
- } else if (aux_data) {
- if (BLE_LL_AUX_CHECK_FLAG(aux_data,
BLE_LL_AUX_INCOMPLETE_ERR_BIT)) {
- report->evt_type |= (BLE_HCI_ADV_DATA_STATUS_TRUNCATED);
- BLE_LL_AUX_SET_FLAG(aux_data, BLE_LL_AUX_TRUNCATED_SENT);
- rc = -1;
- } else if (BLE_LL_AUX_CHECK_FLAG(aux_data,
BLE_LL_AUX_INCOMPLETE_BIT)) {
- report->evt_type |= (BLE_HCI_ADV_DATA_STATUS_INCOMPLETE);
- } else {
- rc = 0;
}
+ } else if (aux_data && (aux_data->flags_ll &
BLE_LL_AUX_FLAG_SCAN_ERROR)) {
+ report->evt_type |= BLE_HCI_ADV_DATA_STATUS_TRUNCATED;
+ rc = -1;
} else {
rc = 0;
}
- ble_ll_hci_event_send(hci_ev);
+ if ((rc == -1) && aux_data) {
+ aux_data->flags_ll |= BLE_LL_AUX_FLAG_SCAN_ERROR;
- if (aux_data) {
- if (!(aux_data->evt_type & BLE_HCI_ADV_SCAN_MASK) ||
- (aux_data->evt_type & BLE_HCI_ADV_SCAN_RSP_MASK)) {
- BLE_LL_AUX_SET_FLAG(aux_data, BLE_LL_SENT_EVENT_TO_HOST);
+ if (!(aux_data->flags_ll & BLE_LL_AUX_FLAG_HCI_REPORT_SENT)) {
+ ble_hci_trans_buf_free((uint8_t *)hci_ev);
+ goto done;
}
+
+ aux_data->flags_ll |= BLE_LL_AUX_FLAG_HCI_REPORT_SENT;
Review comment:
same here, report_sent is already set (checked in if above)
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services