/* Searches the whitelist to determine if the address is present in the whitelist. This is an internal API that only searches the link layer whitelist and does not care about the hardware whitelist */
static int ble_ll_whitelist_search(const uint8_t *addr, uint8_t addr_type)
/* Searches the whitelist to determine if the address is present in the whitelist. This is an internal API that only searches the link layer whitelist and does not care about the hardware whitelist */
static int ble_ll_whitelist_search(const uint8_t *addr, uint8_t addr_type)
{
    int i;
    struct ble_ll_whitelist_entry *wl;
    wl = &g_ble_ll_whitelist[0];
    for (i = 0; i < BLE_LL_WHITELIST_SIZE; ++i) {
        if ((wl->wl_valid) && (wl->wl_addr_type == addr_type) &&
            (!memcmp(&wl->wl_dev_addr[0], addr, BLE_DEV_ADDR_LEN))) {
            return i + 1;
        }
        ++wl;
    }
    return 0;
}