Skip to content

Commit 4c7c998

Browse files
committed
Fix BD address for Nano 33.
Signed-off-by: iabdalkader <[email protected]>
1 parent 36c68b5 commit 4c7c998

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/utility/HCIVirtualTransportZephyr.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@
2525
#include <zephyr/bluetooth/buf.h>
2626
#include <zephyr/bluetooth/hci.h>
2727
#include <zephyr/bluetooth/hci_raw.h>
28+
#include <zephyr/bluetooth/controller.h>
2829
#include <zephyr/drivers/uart.h>
30+
#include <zephyr/drivers/hwinfo.h>
2931

3032
static K_FIFO_DEFINE(rx_queue);
3133
struct k_fifo* __rx_queue = &rx_queue;
@@ -147,6 +149,18 @@ int HCIVirtualTransportZephyrClass::begin() {
147149
#endif /* CONFIG_CYW4343W_MURATA_1DX */
148150
#endif /* CONFIG_BT_HCI_SETUP */
149151

152+
#if CONFIG_BT_LL_SW_SPLIT
153+
// Use unique device id for BD addr.
154+
uint8_t bd_addr[0] = { 0xFA, 0xFA, 0xFA, 0xFA, 0xFA, 0xFA };
155+
156+
#if CONFIG_HWINFO
157+
hwinfo_get_device_id(bd_addr, sizeof(bd_addr));
158+
#endif /* CONFIG_HWINFO */
159+
160+
// Set public address for controller.
161+
bt_ctlr_set_public_addr(bd_addr);
162+
#endif /* CONFIG_BT_LL_SW_SPLIT */
163+
150164
rxbuf.clear();
151165

152166
return 1;

0 commit comments

Comments
 (0)