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

Getting own bluetooth address of device

Hello,

I have migrated from SoftDevice S130 2.0.1 to SoftDevice S132 3.0.0 and found one mismathing in ble_gap_evt_connected_t structure.

There is absent an own_addr field which excites in previous version. I used that field to get local bluetooth address.

static void on_ble_evt(ble_evt_t * p_ble_evt)
{
    uint32_t                err_code;
    const ble_gap_evt_t   * p_gap_evt = &p_ble_evt->evt.gap_evt;

    switch (p_ble_evt->header.evt_id)
    {
        case BLE_GAP_EVT_CONNECTED:
        {
            m_pending_db_disc_conn = p_ble_evt->evt.gap_evt.conn_handle;
            m_retry_db_disc = false;
					
            ble_gap_addr_t * peer_addr;
	        ble_gap_addr_t * own_addr;	
				
	        peer_addr = &p_ble_evt->evt.gap_evt.params.connected.peer_addr;
	        own_addr = &p_ble_evt->evt.gap_evt.params.connected.own_addr;

   ...

How to get local bluetooth address now? with softdevice s132 v3.x.x

Should I use sd_ble_gap_addr_get() function for that? I have tried it but it returns the same values for all chips.

Could you please clarify such detail? Thanks!

Related