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

How to add bonding information manually?

Hi,

I want to add bonding information manually. 

1.can I assume IRK key will be constant for multiple peripherals?

2.if IRK only key is available, can i add it to peer list using pm_peer_new? 

 

Parents Reply
  • I modified advertising Event handler case as below, it causing ERROR 7 NRF_ERROR_INVALID_PARAM] when i start advertising

     ret_code_t ret = ble_advertising_start(&m_advertising, BLE_ADV_MODE_FAST);

    bond_info is filled with bonding information.

    case BLE_ADV_EVT_WHITELIST_REQUEST:
    {
    ble_gap_addr_t whitelist_addrs[BLE_GAP_WHITELIST_ADDR_MAX_COUNT];
    ble_gap_irk_t whitelist_irks[BLE_GAP_WHITELIST_ADDR_MAX_COUNT];
    uint32_t addr_cnt = BLE_GAP_WHITELIST_ADDR_MAX_COUNT;
    uint32_t irk_cnt = BLE_GAP_WHITELIST_ADDR_MAX_COUNT;

    err_code = pm_whitelist_get(whitelist_addrs, &addr_cnt,whitelist_irks, &irk_cnt);
    APP_ERROR_CHECK(err_code);


    memcpy(&(whitelist_irks[0].irk),&(bond_info.peer_ble_id.id_info.irk),16);
    irk_cnt = 1;
    addr_cnt = 0;

    // Apply the whitelist.
    err_code = ble_advertising_whitelist_reply(&m_advertising,whitelist_addrs,addr_cnt,whitelist_irks,irk_cnt);
    APP_ERROR_CHECK(err_code);


    }
    break;

Children
No Data
Related