On Thu, Oct 26, 2017, Jie Zhou wrote:
Looking at the bluetooth API and the sample bluetooth code, tt seems thatUsually 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.