Read MAC address

Posted on
  • Hi,

    I'm trying to develop a small project where I would use the Puck as a HW identifier, combining Eddystone functionality with a unique ID. I was thinking that I could use the MAC address of the Puck as the ID, Base64 encode it and advertise it as part of the Eddystone URL.

    But I can't find a way to read the BT MAC of the device inside the JS code - is it possible?

    Thanks, br:

    --Zsolt

  • You can use getSerial() - I can't remember if it's the address, but it's definitely a unique ID from the chip

  • Thx! I checked the getSerial() function, it returns an 8 byte value as string (in my case "def1e3bd-f8bcb4f9") and it is not the BT MAC (which would be the 6 byte value "FD01C4EBBC8E") for this given Puck.

    Could the BT MAC be exposed (maybe through the NRF object) in a future firmware upgrade? I'm just asking because of the Eddystone URL length limitation I'm trying to get the shortest unique ID possible.

    Thx for the help again, great project!

  • No problem - just filed a bug for it and I'll try and get it added at some point.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Read MAC address

Posted by Avatar for HaZse @HaZse

Actions