Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Static / programmable whitelist

Hi,

Is it possible to add a static bluetooth address to the whitelist?

I am using SDK 14.2.0, device is nrf52832 + peer manager.

BR

bjarke

Parents
  • Hi,

    Whitelist can be used both by peripheral (to filter which centrals can connect) and by central (to filter what peripherals to connect to.) I assume that you need this for a peripheral.

    If you use the Advertising Module then it is your responsibility to provide a whitelist on the BLE_ADV_EVT_WHITELIST_REQUEST event.

    You may then choose to fetch a whitelist from peer manager using pm_whitelist_get(), as is done for instance in the HID Mouse Application example.

    Or, in your case, you may make a whitelist manually using any Bluetooth addresses that you would like. The whitelist is an array of ble_gap_addr_t structures and an array of ble_gap_irk_t structures. (The IRK structure is only needed for resolvable addresses, not for static ones.)

    In any case you must reply to the whitelist request event with a call to ble_advertising_whitelist_reply(), where you provide the whitelist.

    Regards,
    Terje

  • Hi,

    I have tried to send a static address using the ble_advertising_whitelist_reply(), However I can't get it to work.

    Setting up static addr:

    ble_gap_addr_t public_device[1] = {{
        .addr_type = BLE_GAP_ADDR_TYPE_PUBLIC,
        .addr = {0x8d, 0xaa, 0xa4, 0x2d, 0x65, 0x94}, // samsung tablet
    }};
    
    ble_gap_addr_t const * whitelist_addrs = &public_device;
    
    irk_cnt = 0;
    addr_cnt = 1;
    
    err_code = ble_advertising_whitelist_reply(&m_advertising,
        &whitelist_addrs,
        addr_cnt,
        whitelist_irks,
        irk_cnt);

    err_code return is 0

    However advertising never starts.

    If I replace the static addr with the pm_whitelist_get(whitelist_addr, &addr_cnt, whitelist_irks,  &irk_cnt); it works.

    Is there a connection between whitelist, advertising and peer manager behind the scene?

    Regards

    Bjarke

Reply
  • Hi,

    I have tried to send a static address using the ble_advertising_whitelist_reply(), However I can't get it to work.

    Setting up static addr:

    ble_gap_addr_t public_device[1] = {{
        .addr_type = BLE_GAP_ADDR_TYPE_PUBLIC,
        .addr = {0x8d, 0xaa, 0xa4, 0x2d, 0x65, 0x94}, // samsung tablet
    }};
    
    ble_gap_addr_t const * whitelist_addrs = &public_device;
    
    irk_cnt = 0;
    addr_cnt = 1;
    
    err_code = ble_advertising_whitelist_reply(&m_advertising,
        &whitelist_addrs,
        addr_cnt,
        whitelist_irks,
        irk_cnt);

    err_code return is 0

    However advertising never starts.

    If I replace the static addr with the pm_whitelist_get(whitelist_addr, &addr_cnt, whitelist_irks,  &irk_cnt); it works.

    Is there a connection between whitelist, advertising and peer manager behind the scene?

    Regards

    Bjarke

Children
No Data
Related