Zephyr BLE - use public(fixed) address


Purushothaman, Neha <neha.purushothaman@...>
 

Hello,

 

Can Zephyr allow us to use the HW MAC address of the BLE module while advertising?

 

I am working on the BLE sample codes in Zephyr 1.6,  and noticed that while running the Zephyr BLE peripheral_hr sample code(or any other peripheral examples) on quark_se_c1000_devboard that the MAC address keeps changing every time the board is power cycled. The Bluetooth module used is nRF51 Raytac with hci_uart project flashed on.

 

It seems as if when the host requests for the Bluetooth address (common_init() in subsys/bluetooth/host/hci_core.c), the controller returns variable 'pub_addr'  (subsys/bluetooth/controller/ll.c). This variable, not being initialized, results in always returning 0. The host on receiving 0:0:0:0:0:0 from the controller sets static random address, which was why it kept changing every time I reset the board.

 

Is there a way to disable this feature? I could initialize the pub_addr and get a constant MAC address, but that would mean changing it every time i flash a new BLE module. Does Zephyr allow us to just use the public ( or HW) MAC address?

 

Thanks in advance,

Neha


Luiz Augusto von Dentz
 

Hi Neha,

Look at BLUETOOTH_INTERNAL_STORAGE:

https://gerrit.zephyrproject.org/r/gitweb?p=zephyr.git;a=blob;f=subsys/bluetooth/host/Kconfig;h=b2e3775f4f07c5cf786de714e8bb1f6524589cd4;hb=HEAD

There is the shell test that actually set it with arduino 101.

On Wed, Apr 12, 2017 at 12:32 AM, Purushothaman, Neha
<neha.purushothaman@intel.com> wrote:
Hello,



Can Zephyr allow us to use the HW MAC address of the BLE module while
advertising?



I am working on the BLE sample codes in Zephyr 1.6, and noticed that while
running the Zephyr BLE peripheral_hr sample code(or any other peripheral
examples) on quark_se_c1000_devboard that the MAC address keeps changing
every time the board is power cycled. The Bluetooth module used is nRF51
Raytac with hci_uart project flashed on.



It seems as if when the host requests for the Bluetooth address
(common_init() in subsys/bluetooth/host/hci_core.c), the controller returns
variable 'pub_addr' (subsys/bluetooth/controller/ll.c). This variable, not
being initialized, results in always returning 0. The host on receiving
0:0:0:0:0:0 from the controller sets static random address, which was why it
kept changing every time I reset the board.



Is there a way to disable this feature? I could initialize the pub_addr and
get a constant MAC address, but that would mean changing it every time i
flash a new BLE module. Does Zephyr allow us to just use the public ( or HW)
MAC address?



Thanks in advance,

Neha


_______________________________________________
Zephyr-users mailing list
Zephyr-users@lists.zephyrproject.org
https://lists.zephyrproject.org/mailman/listinfo/zephyr-users


--
Luiz Augusto von Dentz