Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d8a81b91 authored by Nitin Arora's avatar Nitin Arora Committed by Andre Eisenbach
Browse files

Fix for premature BLE RPA timeout

RPA timeout expires prematurely when multiple FindMe server
instances start and stop advertisiment continuously. During start
adv TIMER3 is started using oneshot timer and during stop adv
same TIMER0 is stopped, so the TIMER3 is still running and expires
prematurely. This fix stops TIMER3 during disable adv and when RPA
is sent to controller.

Change-Id: I336f84043e5e0e8a833cc6080f8bcc0c1665893e
parent 66030b6b
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -357,7 +357,7 @@ tBTM_STATUS btm_ble_multi_adv_write_rpa (tBTM_BLE_MULTI_ADV_INST *p_inst, BD_ADD
                                    btm_ble_multi_adv_vsc_cmpl_cback)) == BTM_CMD_STARTED)
    {
        /* start a periodical timer to refresh random addr */
        btu_stop_timer(&p_inst->raddr_timer_ent);
        btu_stop_timer_oneshot(&p_inst->raddr_timer_ent);
        p_inst->raddr_timer_ent.param = (TIMER_PARAM_TYPE) p_inst;
        btu_start_timer_oneshot(&p_inst->raddr_timer_ent, BTU_TTYPE_BLE_RANDOM_ADDR,
                         BTM_BLE_PRIVATE_ADDR_INT);
@@ -739,8 +739,8 @@ tBTM_STATUS BTM_BleDisableAdvInstance (UINT8 inst_id)
            == BTM_CMD_STARTED)
         {
            btm_ble_multi_adv_configure_rpa(&btm_multi_adv_cb.p_adv_inst[inst_id-1]);
            btu_stop_timer(&btm_multi_adv_cb.p_adv_inst[inst_id-1].raddr_timer_ent);
            btm_multi_adv_cb.p_adv_inst[inst_id-1].in_use = FALSE;
            btu_stop_timer_oneshot(&btm_multi_adv_cb.p_adv_inst[inst_id-1].raddr_timer_ent);
            btm_multi_adv_cb.p_adv_inst[inst_id-1].inst_id = 0;
         }
     }
    return rt;