This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to add multiple devices to whitelist

How do I add multiple devices to a whitelist (as the central, adding peripherals), then use the white list for multiple connections? I have read both

devzone.nordicsemi.com/.../

and

devzone.nordicsemi.com/.../

but I don't know how to properly add a device to a white list with out stepping over information from the previous connection.

One specific spot is

 whitelist.addr_count = BLE_GAP_WHITELIST_ADDR_MAX_COUNT;

err_code = dm_whitelist_create(&m_app_handle, &whitelist);

if ((whitelist.addr_count != 0) || (whitelist.irk_count != 0))

This seems to be deterministic in its approach, if you set addr_count, then you will know if it will be equal to zero or not.

(This is using SDK 11, the s130 soft device, and pca10028 dev boards)

Parents
  • From the function Documentation of SDK v11.0.0

    'addr_count' and 'irk_count' fields of the structure should be populated with the maximum number of devices that the application wishes to request in the whitelist. If the number of bonded devices is less than requested, the fields are updated with that number of devices. If the number of devices are more than requested, the module will populate the list with devices in the order the bond was established with the peer devices. Also, if this routine is called when a connection exists with one or more peer devices, those connected devices are not added to the whitelist.

    This implies that the "addr_count" doesn't have an absolute meaing, it is used both to set a maximum number of devices and then, once used to create a whitelist, it is updated with a different meaning (the number of bonded devices).

Reply
  • From the function Documentation of SDK v11.0.0

    'addr_count' and 'irk_count' fields of the structure should be populated with the maximum number of devices that the application wishes to request in the whitelist. If the number of bonded devices is less than requested, the fields are updated with that number of devices. If the number of devices are more than requested, the module will populate the list with devices in the order the bond was established with the peer devices. Also, if this routine is called when a connection exists with one or more peer devices, those connected devices are not added to the whitelist.

    This implies that the "addr_count" doesn't have an absolute meaing, it is used both to set a maximum number of devices and then, once used to create a whitelist, it is updated with a different meaning (the number of bonded devices).

Children
No Data
Related