Esempio n. 1
0
void btu_oneshot_alarm_ready(fixed_queue_t *queue, UNUSED_ATTR void *context) {
    TIMER_LIST_ENT *p_tle = (TIMER_LIST_ENT *)fixed_queue_dequeue(queue);
    btu_general_alarm_process(p_tle);

    switch (p_tle->event) {
#if (defined(BLE_INCLUDED) && BLE_INCLUDED == TRUE)
        case BTU_TTYPE_BLE_RANDOM_ADDR:
            btm_ble_timeout(p_tle);
            break;
#endif

        case BTU_TTYPE_USER_FUNC:
            {
                tUSER_TIMEOUT_FUNC  *p_uf = (tUSER_TIMEOUT_FUNC *)p_tle->param;
                (*p_uf)(p_tle);
            }
            break;

        default:
            // FAIL
            BTM_TRACE_WARNING("Received unexpected oneshot timer event:0x%x\n",
                p_tle->event);
            break;
    }
}
Esempio n. 2
0
/*******************************************************************************
**
** Function         btm_find_dev_by_identity_addr
**
** Description      find the security record whose LE static address is matching
**
*******************************************************************************/
tBTM_SEC_DEV_REC *btm_find_dev_by_identity_addr(BD_ADDR bd_addr, UINT8 addr_type)
{
#if BLE_PRIVACY_SPT == TRUE
    UINT8 i;
    tBTM_SEC_DEV_REC *p_dev_rec = &btm_cb.sec_dev_rec[0];

    for (i = 0; i < BTM_SEC_MAX_DEVICE_RECORDS; i ++, p_dev_rec ++) {
        if ((p_dev_rec->sec_flags & BTM_SEC_IN_USE) &&
                memcmp(p_dev_rec->ble.static_addr, bd_addr, BD_ADDR_LEN) == 0) {
            if ((p_dev_rec->ble.static_addr_type & (~BLE_ADDR_TYPE_ID_BIT)) !=
                    (addr_type & (~BLE_ADDR_TYPE_ID_BIT))) {
                BTM_TRACE_WARNING("%s find pseudo->random match with diff addr type: %d vs %d",
                                  __func__, p_dev_rec->ble.static_addr_type, addr_type);
            }

            /* found the match */
            return p_dev_rec;
        }
    }
#endif

    return NULL;
}