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

change MAC address in ble_app_beacon example

Greetings,

For my application,I need to change the nrf51's mac address. Previously I have changed the MAC id using the following code,

static ble_gap_addr_t m_central_addr;

m_central_addr.addr_type = BLE_GAP_ADDR_TYPE_RANDOM_STATIC;

m_central_addr.addr[0] = (uint8_t)NRF_FICR->DEVICEADDR[0];

m_central_addr.addr[1] = (uint8_t)(NRF_FICR->DEVICEADDR[0] >> 8);

m_central_addr.addr[2] = (uint8_t)(NRF_FICR->DEVICEADDR[0] >> 16);

m_central_addr.addr[3] = (uint8_t)(NRF_FICR->DEVICEADDR[0] >> 24);

m_central_addr.addr[4] = (uint8_t)NRF_FICR->DEVICEADDR[1];

m_central_addr.addr[5] = (uint8_t)((NRF_FICR->DEVICEADDR[1] >> 8) | 0xC0); // 2MSB must be set 11

sd_ble_gap_addr_set(&m_central_addr);

The same working code is not working for ble_app_beacon example.

How can I change the MAC id for ble_app_beacon example.

Related