sandeepmistry / arduino-BLEPeripheral

An Arduino library for creating custom BLE peripherals with Nordic Semiconductor's nRF8001 or nR51822.
MIT License
461 stars 179 forks source link

How to change MAC ID in NRF52 #244

Open Autobot86 opened 5 years ago

Autobot86 commented 5 years ago

hi friends am the beginner of nrf52832. i try to code for simple iBeacon i have doubt as what is the use of line " unsigned short measuredPower = -55;" ?? i find there is no change after assign values to it and how to edit device macid in that code.

Autobot86 commented 5 years ago

i try to change device address using this function

static ble_gap_addr_t m_central_addr; m_central_addr.addr_type = BLE_GAP_ADDR_TYPE_RANDOM_STATIC; m_central_addr.addr[0] = 0xfd; m_central_addr.addr[1] = 0x71; m_central_addr.addr[2] = 0x5f; m_central_addr.addr[3] = 0x45; m_central_addr.addr[4] = 0x2b; m_central_addr.addr[5] = 0xc6; // 2MSB must be set 11

for (int i = 0; i < 5; i++) Serial.println(m_central_addr.addr[i]);

sd_ble_gap_address_set(&m_central_addr);

but error come how can i change device address in my NRF52 board in arduino code

AnthonyAchoy commented 4 years ago

Could you solve it?

AnthonyAchoy commented 4 years ago

I can actually compile but it doesn't modify the device address, I tried calling the funcion in many places, but it just print the elements of the array.