I have a question about Bluetooth MAC address.

Get the BLE address with sd_ble_gap_address_get() and send it to the smartphone app on the other device.
However, I noticed that the address that can be obtained with sd_ble_gap_address_get() is different every time,

and when I investigated, the address type was "BLE_GAP_ADDR_TYPE_RANDOM_STATIC".
I would like to get the address of "BLE_GAP_ADDR_TYPE_PUBLIC" which is always unique.

In another question, there was an answer to sd_ble_gap_address_set() "BLE_GAP_ADDR_TYPE_PUBLIC",

but instead I want to get the address registered by the IEEE Registration Authority.

Parents
  • Hello,

    Are you seeing this with any of our SDK examples? sd_ble_gap_address_get() should always return the same address unless your application is calling sd_ble_gap_address_set() at some point to override the default HW address (is a random static address). There is no public address provisioned on the chip. 

    You can read more about the different address type in this post:  bluetooth address : built-in or random ? . 

    Best regards,

    Vidar

  • Mr. Vidar Berg

    First, sd_ble_gap_address_get(), sd_ble_gap_address_set()
    was wrong.
    Correctly sd_ble_gap_addr_get(), sd_ble_gap_addr_set()
    was.

    Then I checked the link.

    What I want to achieve is to display the MAC address displayed under the device in the android app nRFConnect in the iOS app as well.
    For that I tried the following:


    sd_ble_gap_addr_get(&device_addr)


    macaddr[0] = *((uint32_t *)0x100000A4);
    macaddr[1] = *((uint32_t *)0x100000A8);
    mcp = (uint8_t *)(&macaddr[0]);
    for(i=0;i<6;i++)
    {
    caddr.addr[i] = *mcp++;
    }


    NRF_FICR->DEVICEADDR[0];
    NRF_FICR->DEVICEADDR[0]>>8;
    NRF_FICR->DEVICEADDR[0]>>16;
    NRF_FICR->DEVICEADDR[0]>>24;
    NRF_FICR->DEVICEADDR[1];
    NRF_FICR->DEVICEADDR[1]>>8;

    However, none of them are different from the MAC address displayed in the android app nRFConnect.
    Additionally, the value changes each time you access it.
    I understand this is because it is "BLE_GAP_ADDR_TYPE_RANDOM_STATIC".
    So how can I get the MAC address displayed on nRFConnect?

Reply
  • Mr. Vidar Berg

    First, sd_ble_gap_address_get(), sd_ble_gap_address_set()
    was wrong.
    Correctly sd_ble_gap_addr_get(), sd_ble_gap_addr_set()
    was.

    Then I checked the link.

    What I want to achieve is to display the MAC address displayed under the device in the android app nRFConnect in the iOS app as well.
    For that I tried the following:


    sd_ble_gap_addr_get(&device_addr)


    macaddr[0] = *((uint32_t *)0x100000A4);
    macaddr[1] = *((uint32_t *)0x100000A8);
    mcp = (uint8_t *)(&macaddr[0]);
    for(i=0;i<6;i++)
    {
    caddr.addr[i] = *mcp++;
    }


    NRF_FICR->DEVICEADDR[0];
    NRF_FICR->DEVICEADDR[0]>>8;
    NRF_FICR->DEVICEADDR[0]>>16;
    NRF_FICR->DEVICEADDR[0]>>24;
    NRF_FICR->DEVICEADDR[1];
    NRF_FICR->DEVICEADDR[1]>>8;

    However, none of them are different from the MAC address displayed in the android app nRFConnect.
    Additionally, the value changes each time you access it.
    I understand this is because it is "BLE_GAP_ADDR_TYPE_RANDOM_STATIC".
    So how can I get the MAC address displayed on nRFConnect?

Children
No Data
Related