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

SDK13, S132, peripherial mode. How bonding does work? In HRS example

Hi all! I write for nRF52 but I can't to understand it. There are two cases:

first- I want bound my peripherial with central. And in future I want connect only between those 2 devices. How should I do? Use whitelist on the central? And when first time connected central to periperial, this connection writed to memory of whitelist? Next on the central side I should set usewhitelist = 1? And at this case I always will connect only first connected device? Right?

Second case- I need only connect by peripherial to any device like smartfone. Without bonding. How should I do it? Which one settings should set in HRS ex.? What does it mean SEC_PARAM_BOND? In HRS set 1. I suppose, in this example, connect set with bonding?

Explain, pls.

Parents
  • You can use whitelist on either the peripheral or the central.

    Using it on the peripheral will filter out scan requests and/or connections requests from devices that are not in the whitelist.

    Using it on the central will filter out advertisments from devices that are not in the whitelist.

    If you don't want to pair call pm_sec_params_set() with NULL, if you don't want to bond call pm_sec_params_set() with bond set to 0, i.e. set SEC_PARAM_BOND 0.

  • Hi! Thanks. Correct I understand, if I want only connect to smartfone without bond, I should set SEC_PARAM_BOND to 0? And in this case I will use mode pairing without bonding?

    What should use in the case PM_EVT_BONDED_PEER_CONNECTED and in a case PM_EVT_CONN_SEC_SUCCEEDED in a pm_evt_handler? For what use next code:

    err_code = pm_peer_rank_highest(p_evt->peer_id);

    ?

    Should I use this code for bond or for without bond?

Reply
  • Hi! Thanks. Correct I understand, if I want only connect to smartfone without bond, I should set SEC_PARAM_BOND to 0? And in this case I will use mode pairing without bonding?

    What should use in the case PM_EVT_BONDED_PEER_CONNECTED and in a case PM_EVT_CONN_SEC_SUCCEEDED in a pm_evt_handler? For what use next code:

    err_code = pm_peer_rank_highest(p_evt->peer_id);

    ?

    Should I use this code for bond or for without bond?

Children
No Data
Related