rymanluk commented on a change in pull request #73: Refactor RPA handling in controller URL: https://github.com/apache/mynewt-nimble/pull/73#discussion_r186000083
########## File path: nimble/controller/src/ble_ll_adv.c ########## @@ -239,16 +240,29 @@ ble_ll_adv_rpa_update(struct ble_ll_adv_sm *advsm) void ble_ll_adv_chk_rpa_timeout(struct ble_ll_adv_sm *advsm) { - uint32_t now; - if (advsm->own_addr_type < BLE_HCI_ADV_OWN_ADDR_PRIV_PUB) { return; } - now = os_time_get(); - if ((int32_t)(now - advsm->adv_rpa_timer) >= 0) { + if (advsm->flags & BLE_LL_ADV_SM_FLAG_ADV_RPA_TMO) { ble_ll_adv_rpa_update(advsm); - advsm->adv_rpa_timer = now + ble_ll_resolv_get_rpa_tmo(); + advsm->flags &= ~BLE_LL_ADV_SM_FLAG_ADV_RPA_TMO; + } +} + +void +ble_ll_adv_rpa_timeout(void) +{ + struct ble_ll_adv_sm *advsm; + int i; + + for (i = 0; i < BLE_ADV_INSTANCES; i++) { + advsm = &g_ble_ll_adv_sm[i]; + + if (advsm->adv_enabled) { Review comment: Would it make sense to check if advertising instance is using RPA before setting this flag? ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services