Itsby Bitsby NRF 52 - Mac address

Please tell us which board you are using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
olivier1870
 
Posts: 19
Joined: Mon Dec 18, 2017 5:12 am

Itsby Bitsby NRF 52 - Mac address

Post by olivier1870 »

HI
would someone know how to get the mac address of the itsby bitsby from Arduino IDE?
The Arduino Bluefruit library seems to have a function getAddr().. howvever I m unable to program it properly!
Many thanks



/**
* Get current Mac address and its type
* @param mac address
* @return Address type e.g BLE_GAP_ADDR_TYPE_RANDOM_STATIC
*/
uint8_t AdafruitBluefruit::getAddr (uint8_t mac[6])
{
ble_gap_addr_t gap_addr;
sd_ble_gap_addr_get(&gap_addr);

memcpy(mac, gap_addr.addr, 6);
return gap_addr.addr_type;
}

User avatar
mikeysklar
 
Posts: 13936
Joined: Mon Aug 01, 2016 8:10 pm

Re: Itsby Bitsby NRF 52 - Mac address

Post by mikeysklar »

The DEVICEADDR0 and DEVICEADDR1 should show the combined BLE address for your Itsy Bitsy. You can try printing those values out assuming you are using the Adafruit_nRF52_Arduino code.

https://github.com/adafruit/Adafruit_nR ... nrf52810.h

Here is an example of how the Arduino BLE library does it just slightly different, but a helpful example.

Code: Select all

#include <ArduinoBLE.h>

void setup()
{
  Serial.begin( 9600 );
  while ( !Serial );
}

void loop()
{
  Serial.print( "Device ID 0: " );
  Serial.println( NRF_FICR->DEVICEID[0], HEX );
  Serial.print( "Device ID 1: " );
  Serial.println( NRF_FICR->DEVICEID[1], HEX );

  Serial.print( "Device Address 0: " );
  Serial.println( NRF_FICR->DEVICEADDR[0], HEX );
  Serial.print( "Device Address 1: " );
  Serial.println( NRF_FICR->DEVICEADDR[1], HEX );

  delay ( 5000 );
}
https://forum.arduino.cc/t/board-serial-number/661803

Locked
Please be positive and constructive with your questions and comments.

Return to “Itsy Bitsy Boards”