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

Establishing a connection with a bonded phone

I have the following problem:

  • 1 to 3 phones are bonded with an nRF52832
  • These phones are on the whitelist of nRF52832
  • nRF52832 goes into Power Off Mode
  • nRF52832 is woken by a sensor and wants to send this current value to a cell phone that is on the whitelist.

I only need to establish a connection after waking up so that I can send the data
The only thing missing is the connection after waking up so I can send the data. The other functions are implemented.

Is there an example for the connection establishment? Probably I have to read the connection data of the glued devices from the whitelist?

Thank you in advance

Best regards,
Werner Loser

Parents Reply Children
  • Hello,

    I have read the content in the links.
    In addition, I worked through the following tutorials and read several blogs
    devzone.nordicsemi.com/.../bluetooth-smart-and-the-nordics-softdevices-part-2
    devzone.nordicsemi.com/.../bluetooth-smart-and-the-nordics-softdevices-part-1


    Sorry, but I'm still missing the entry point to establish a connection via the peer manager (prefix pm) with an entry in the whitelist.
    Is it correct that I need IRK in my case?
    To make it easier, I would start with only one entry in the whitelist (Only 1 Device bonded)
    The whitelist is completely managed by the peer manager - is that correct?
    What is the maximum size of the whitelist?
    Again, are there one or more examples or which functions with which parameters do I have to call for this?

    Thank you in advance

    Best regards,
    Werner Loser

  • The Peer manager has a function to configure the whitelist. If you look at the ble_hids_keyboard example you can see the function: whitelist_set being called before the call to ble_advertising_start. This function will end up calling sd_ble_gap_whitelist_set to configure the sd. The maximum number of entries are defined in ble_gap.h:

    /**@brief Maximum amount of addresses in the whitelist. */
    #define BLE_GAP_WHITELIST_ADDR_MAX_COUNT (8)
    
    
    /**@brief Maximum amount of identities in the device identities list. */
    #define BLE_GAP_DEVICE_IDENTITIES_MAX_COUNT (8)

  • Hello,

    sorry if I ask the questions differently again, but the answer does not help me.

    Question 1

    On the peripheral side the connection with Advertising works if the whitelist is configured ( init.config.ble_adv_whitelist_enabled = true; ).

    But on the central side I did not understand how can I start a scan with only one or more whitelist entriy/entries.

    Question 2

    Is it correct that I need IRK in my case?

    Question 3

    The whitelist is completely managed by the peer manager - is that correct?

    Question 4

    Again, are there one or more examples or which functions with which parameters do I have to call for this?

    Thank you in advance

    Best regards,
    Werner Loser

  • 1. Sorry, I did not realize you where also asking about scanning. Did you already read the documentation her: Whitelist?

    2. The IRK will normally be exchanged at the end of the pairing process. If the peer devices uses a resolvable private address you need the IRK.

    3. Yes, it's stored when exchanged. But the application has to tell the SD to use the whitelist. As mentioned in my previous reply.

    4. Did you already look at the hids_keyboard example? Main.c: line 353. For scanning look atthe function nrf_ble_scan_start in nrf_ble_scan.c. This takes a struct called: nrf_ble_scan_t -> ble_gap_scan_params_t  set the filter policy to whitelist.

Related