I want to get mac address using NRF5340_DK
Which function is used to get print mac address using NRF5340_DK.
I try to print the current device's MAC address using NRF5340_DK. So
I want to get mac address using NRF5340_DK
Which function is used to get print mac address using NRF5340_DK.
I try to print the current device's MAC address using NRF5340_DK. So
Hi,
Please see this post (note that the FICR approach from the other approach in that thread does not work from the app core on the nRF5340).
Thanks for reply
Hi
I tried these bt_id_get()
or bt_le_oob_get_local() they should not give correct mac address
Hi,
Ah, you are right, that does not work with the random static address. I tested now, and bt_read_static_addr() works. You can use it like this:
static char addr_str[BT_ADDR_STR_LEN]; struct bt_hci_vs_static_addr addr; int addr_count; addr_count = bt_read_static_addr(&addr, 1); if (addr_count > 0) { bt_addr_to_str(&(addr.bdaddr), addr_str, sizeof(addr_str)); printk("BT addr: %s\n", addr_str); }
Note that you need the following includes:
#include <zephyr/bluetooth/hci_vs.h> #include <zephyr/drivers/bluetooth/hci_driver.h>
And also need CONFIG_BT_HCI_VS_EXT=y
in your prj.conf or similar.
hii
Thanks for reply
I already include
#include <zephyr/bluetooth/hci_vs.h>
#include <zephyr/drivers/bluetooth/hci_driver.h>
Hello,
I wanna read and write MAC address no matter it's public or static one,but must be the same one.
and I am using NRF52833DK, I know bt_read_static_addr() to get static MAC address via this this article.
Now I wanna set this address,do these any API to change it?
Regards,
Matin