esp_ble_gap_update_whitelist add multiple adresses

yemred
Posts: 7
Joined: Tue Nov 16, 2021 6:37 am

esp_ble_gap_update_whitelist add multiple adresses

Postby yemred » Tue Dec 21, 2021 12:54 pm

i wanna have 100 devices into whitelist. but my problem is i tried lots of ways but couldnt add or i am not sure.
for example code below if can add 5 adresses it is always reading the first device. and whitelist size is 9. when i try to add 3 addr then size again 9 but this time it is reading 2. or 3. device too.

my question is about how to add 100 or more devices. what must be the size, why

Code: Select all

esp_ble_gap_get_whitelist_size(&lngth);
code doesnt work properly. maybe i am trying to add new devices by wrong way but then what is the sorrect way

the code is one of the examples ble_eddystone.
need help
thanks a lot for reading and replying

Code: Select all

static void wl_add(void){

    for (int i=0;i<3;i++){
        if(i==0){
            esp_bd_addr_t whitelist_addr = {0x60, 0xc0, 0xbf, 0x28, 0xa4, 0x34};
            esp_ble_gap_update_whitelist(true, whitelist_addr, BLE_ADDR_TYPE_PUBLIC);
        }
        if(i==1){
            esp_bd_addr_t whitelist_addr = {0x60, 0xc0, 0xbf, 0x28, 0xa4, 0x33};
            esp_ble_gap_update_whitelist(true, whitelist_addr, BLE_ADDR_TYPE_PUBLIC);
        }
        if(i==2){
            esp_bd_addr_t whitelist_addr = {0x60, 0xc0, 0xbf, 0x28, 0xa4, 0x32};
            esp_ble_gap_update_whitelist(true, whitelist_addr, BLE_ADDR_TYPE_PUBLIC);
        }
        if(i==3){
            esp_bd_addr_t whitelist_addr = {0x60, 0xc0, 0xbf, 0x28, 0xa4, 0x31};
            esp_ble_gap_update_whitelist(true, whitelist_addr, BLE_ADDR_TYPE_PUBLIC);
        }
        else{
            esp_bd_addr_t whitelist_addr = {0x60, 0xc0, 0xbf, 0x28, 0xa4, 0x30};
            esp_ble_gap_update_whitelist(true, whitelist_addr, BLE_ADDR_TYPE_PUBLIC);
        }
    }
    uint16_t lngth;
    esp_ble_gap_get_whitelist_size(&lngth);
    printf("%d\n",lngth);
}

Who is online

Users browsing this forum: Baidu [Spider] and 89 guests