Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs

Central Connection Establishment with Private Peer (Resolvable Random Private Address)

Hello,

I am trying to establish a connection with a peer with Resolvable Random Private address.

Based on Noridc GAP API documentation (https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v6.0.0/group___b_l_e___g_a_p___c_e_n_t_r_a_l___c_o_n_n___p_r_i_v___m_s_c.html), the  sd_ble_gap_device_identities_set() should be called prior to sd_ble_gap_connect().

In my case the sd_ble_gap_device_identities_set function returns 0x3202 (BLE_ERROR_GAP_INVALID_BLE_ADDR Invalid address type is supplied.). Please see below a code example.

m_peer_addr.addr[5] = 0x73;
m_peer_addr.addr[4] = 0x8D;
m_peer_addr.addr[3] = 0x8B;
m_peer_addr.addr[2] = 0xCC;
m_peer_addr.addr[1] = 0xF5;
m_peer_addr.addr[0] = 0x42;

m_peer_addr.addr_type = BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_RESOLVABLE;//BLE_GAP_ADDR_TYPE_PUBLIC;
m_peer_addr.addr_id_peer = 1;

ble_gap_irk_t peer_gap_irk_value;
memcpy(&peer_gap_irk_value.irk[0],&irk_value[0],16);

ble_gap_id_key_t peer_gap_key_id = {
    .id_info = peer_gap_irk_value,
    .id_addr_info = m_peer_addr
};
          
ble_gap_id_key_t const * const p_gap_id_key = &peer_gap_key_id;
          
err_code = sd_ble_gap_device_identities_set(&p_gap_id_key,NULL,1); // ----> returns 0x3202 (BLE_ERROR_GAP_INVALID_BLE_ADDR Invalid address type is supplied.)

I wonder if I am missing something.

Thank you in advance.

Adrian.

Parents Reply Children
No Data
Related