Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob

BD_ADDR - how do you get one?

BD_ADDR - how do you get one?

Anonymous
Not applicable

One of the most common questions that is often asked is about the BD_ADDR for Bluetooth SMART (WICED SMART) and how to go about getting one. In this post I would like to provide some insights into this topic and some suggestions on how to make the process simple and straightforward.

So first – what is the BD_ADDR?

BD_ADDR is defined in the Bluetooth specification as the “Bluetooth Device Address” – which is used to identify a Bluetooth device. In version 4.0 of the Bluetooth baseband specification (Core System Package) section 1.2 it is stated that “Each Bluetooth device shall be allocated a unique 48-bit Bluetooth device address and that this address shall be obtained from the IEEE Registration Authority. The address shall be created in accordance with “48-bit universal LAN MAC address” of the IEEE 802 specification.”

So at first glance basically the BD_ADDR is the same (or from the same source and format) as the Ethernet MAC address, or more generically the 802.x MAC address since WI-FI (802.11) follows essentially the same specification for its 48-bit MAC address.

However there are a few minor differences between the BD_ADDR and the 48-bit Ethernet MAC address, and also Bluetooth SMART allows a different way to obtain the address and this will also be explained below.

First – going back to where do you get the BD_ADDR from? The specification is quite clear in that this comes from the IEEE Registration Authority. What this exactly means is that the most significant 24 bits of the address are the same as the Organizational Unique Identifier (OUI) that can be obtained from the IEEE at http://standards.ieee.org/develop/regauth/oui/

Now let’s talk about the similarity and differences between the BD_ADDR and the WIFI MAC address. At a first level approximation – both are identical. The upper 24 bits are the OUI, and the lower 24-bits are a unique number that is assigned by the manufacturer for that device. However the WIFI MAC address does have a couple of bits in the OUI that can be different. Bit 0 of the MSB is used to indicate whether the address is a unicast address or a multicast address. And Bit 1 of the MSB is used to indicate whether the address is globally unique (OUI enforced) or locally administered. Bit for all practical purposes a globally unique unicast WIFI MAC address can be used as a BD_ADDR and vice-versa.

When it comes to pure Bluetooth SMART devices (devices that do not have a Bluetooth SMART READY radio or devices that do not need to interface to Bluetooth SMART READY devices via classic profiles) and do not have the need to be on a public visible network (say for example very short range devices inside your closet in your bathroom that just connect to your phone) it is possible to use a random device address. This is described in Volume 6 Part B of the Bluetooth 4.0 specification (Section 1.3). This random address is also 48-bits in length with different requirements based on the type of random address being specified. The details of the types of random addresses allowed are defined in section 10.8 of part C (Generic Access Profile) section of Volume 3 of the Bluetooth 4.0 specification.

Devices are allowed to have both a unique and a random address and use these for different purposes.

Some general guidelines –

  1. If your organization already has a valid OUI, generate a unique address just like you would for 802.x devices like Ethernet or WiFi using this OUI. You could use the WiFi MAC address for your BD_ADDR, but generally it is not a good idea to use the same address for both your WiFi and Bluetooth devices.
  2. If you do not care about your device being globally unique, then you can use a static random address with the constraint that the two most significant bits of the address need to be 1, and you cannot have all of the remaining 46 bits be either all 1 or all 0. This address can change between hardware resets, but is generally recommended not to change otherwise because this would be mean that any previous connections would become invalid without the peer being notified.
  3. If you really don’t want anyone to sniff your packets and your application supports it, you can also use private non-resolvable random addresses or private resolvable random addresses. Details are in the Bluetooth specification.
0 Likes
3970 Views
Comments
joki_2146851
Level 3
Level 3
5 likes given First like received First like given

1) I plan on making many devices that are a local -- act within a short range, and don't want spend $2500 to register my company to get a OUI. So your telling me I can just use the random number generation with the two most significant bits fixed to 1 -- Just checking my understanding of what you have said above.

2) How do I get this device address encoded into my device. I'm using the heart rate monitor demo, but I don't see where the 48bits are being configured in order to change them.  Also If I look at the device ID that is reported on the development kit, or any other of the devices 20:73:2A:09:3E:41, when I look the first 24 bits up (reading from left to right), I don't see Broadcom as the owner of this address, nor are the first two leading bits zero, so I'm confused... Please help!

MichaelF_56
Moderator
Moderator
Moderator
250 sign-ins 25 comments on blog 10 comments on blog

You can use random BD_ADDRs if you feel these will work within your design.

This thread shows you how to program BD_ADDRs: BD_ADDR: Changing BCM20737 Board Address for Production

kellyr j.t

Contributors