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

How to connect my device with one special Central Device(Andriod and Iphone))

Hi nordic, Is there any ways to implement that my device connect with one special Central Device likes Andriod phone and Iphone. Currently I know is whitelist. First I add the special Central Device mac address to my whitelists, and then I filter the other devices to do a connection. Thats may be effective to Andriod phone because its address will not change, but for Iphone it may not works because Iphone's mac address will changes when it do scanning ,so how to deal with that? Please give some advice and I will be grateful.

  • FormerMember
    0 FormerMember

    Yes, for Android phone you can the device mac address for central directly.

    For the iPhone, that uses random resolvable address, you should add its IRK to the whitelist. Upon a connect request from an iPhone, the nRF51/52 device will accept or reject the connect request based on the iPhones IRK.

  • OK ,thanks, and how to get its IRK from iphone. Is there a tutorial or example that I can reference?

  • FormerMember
    0 FormerMember in reply to FormerMember

    The IRK is part of the information that is exchanged during the bonding process. It means that the devices have to bond with the iOs device before adding to the whitelist.

  • Hello, When can I exactly extract the IRK to add it manually on the whitelist ( which event ) ? I want to manage my connection and be able to add and remove manually the differents adress.

  • FormerMember
    0 FormerMember in reply to FormerMember

    The IRK can be extracted when two devices get connected, from the connected event, BLE_GAP_EVT_CONNECTED. The peer_manager modules can handle storing of bonding information.

    For how to extract an IRK, see im_ble_evt_handler (id_manager.c).