Re: Bluetooth Address Type - Fixed (public)


Johan Hedberg
 

Hi Jie,

On Thu, Oct 26, 2017, Jie Zhou wrote:
Looking at the bluetooth API and the sample bluetooth code, tt seems that
the default advertised address addr->type is random. I think this is
because of security reasons, so it is using resolvable private addresses.
Is there a way for me to change the address type to public (i.e. fixed) for
my curie board? I see it in the API that there is cases for public
bluetooth address. However, I just can't seem to find how to change the
addr-type to public. I see the #define BT_ADDRLE_PUBLIC 0x00 in
include/bluetooth/hci.h, but don't know how to implement it. Does anyone
know how to do this?
Usually a host stack doesn't have to do anything special with public
addresses since controllers that support them come with the address
pre-programmed. All you need to say is that you want to use it.

You might want to read up on the Bluetooth address types in the
Bluetooth Core specification, since it seems you have the details a bit
mixed up. You can find the relevant information in "Vol 6, Part B,
section 1.3 Device Address". You'll see that using a random address is
not necessarily for security reasons. E.g. if a device doesn't have a
public address, then a static random address can act as the Identity
Address (which is the case with the current Zephyr controller).

Also note that public addresses are managed by each company that the OUI
in the address belongs to, so you shouldn't just go creating arbitrary
public addresses and using them.

This all said, we do have an HCI vendor extension that lets the host
stack set a public address to the controller (remember, the Zephyr
controller starts with no public address at all). However, currently the
host-side has no code for using this vendor HCI command. It should be
fairly simple to add though, and I might have the time to look at it in
the coming weeks.

Johan

Join devel@lists.zephyrproject.org to automatically receive all group messages.