Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/nrf/libraries/others/hw_id.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ You can configure one of the following Kconfig options to choose the hardware ID

* :kconfig:option:`CONFIG_HW_ID_LIBRARY_SOURCE_IMEI` - This option specifies the :term:`International Mobile (Station) Equipment Identity (IMEI)` of the modem.
* :kconfig:option:`CONFIG_HW_ID_LIBRARY_SOURCE_UUID` - This option specifies the UUID of the modem.
* :kconfig:option:`CONFIG_HW_ID_LIBRARY_SOURCE_BLE_MAC` - This option specifies the default Bluetooth® Low Energy MAC address.
* :kconfig:option:`CONFIG_HW_ID_LIBRARY_SOURCE_BT_DEVICE_ADDRESS` - This option specifies the Bluetooth® Device Address.
* :kconfig:option:`CONFIG_HW_ID_LIBRARY_SOURCE_NET_MAC` - This option specifies the MAC address of the default network interface.
* :kconfig:option:`CONFIG_HW_ID_LIBRARY_SOURCE_DEVICE_ID` - This option specifies a serial number provided by Zephyr's HW Info API.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -886,6 +886,10 @@ Other libraries

* Added support for the nRF54LM20A SoC.

* :ref:`lib_hw_id` library:

* The ``CONFIG_HW_ID_LIBRARY_SOURCE_BLE_MAC`` Kconfig option has been renamed to :kconfig:option:`CONFIG_HW_ID_LIBRARY_SOURCE_BT_DEVICE_ADDRESS`.

Shell libraries
---------------

Expand Down
2 changes: 1 addition & 1 deletion include/hw_id.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
extern "C" {
#endif

#if defined(CONFIG_HW_ID_LIBRARY_SOURCE_BLE_MAC)
#if defined(CONFIG_HW_ID_LIBRARY_SOURCE_BT_DEVICE_ADDRESS)
#define HW_ID_LEN (12 + 1)
#elif defined(CONFIG_HW_ID_LIBRARY_SOURCE_DEVICE_ID)
#define HW_ID_LEN (16 + 1)
Expand Down
4 changes: 2 additions & 2 deletions lib/hw_id/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ config HW_ID_LIBRARY_SOURCE_UUID
help
This option requires modem firmware v1.3.0 or higher.

config HW_ID_LIBRARY_SOURCE_BLE_MAC
bool "BLE MAC address"
config HW_ID_LIBRARY_SOURCE_BT_DEVICE_ADDRESS
bool "Bluetooth Device Address"
depends on BT

config HW_ID_LIBRARY_SOURCE_NET_MAC
Expand Down
10 changes: 5 additions & 5 deletions lib/hw_id/hw_id.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
#include <zephyr/kernel.h>

/* includes for the different HW ID sources */
#if defined(CONFIG_HW_ID_LIBRARY_SOURCE_BLE_MAC)
#if defined(CONFIG_HW_ID_LIBRARY_SOURCE_BT_DEVICE_ADDRESS)
#include <zephyr/bluetooth/bluetooth.h>
#endif /* defined(CONFIG_HW_ID_LIBRARY_SOURCE_BLE_MAC) */
#endif /* defined(CONFIG_HW_ID_LIBRARY_SOURCE_BT_DEVICE_ADDRESS) */
#if defined(CONFIG_HW_ID_LIBRARY_SOURCE_DEVICE_ID)
#include <zephyr/drivers/hwinfo.h>
#endif /* defined(CONFIG_HW_ID_LIBRARY_SOURCE_DEVICE_ID) */
Expand All @@ -26,8 +26,8 @@

#define IMEI_LEN 15

#if defined(CONFIG_HW_ID_LIBRARY_SOURCE_BLE_MAC)
/* Ask BLE stack for default MAC address */
#if defined(CONFIG_HW_ID_LIBRARY_SOURCE_BT_DEVICE_ADDRESS)
/* Ask Bluetooth stack for default MAC address */

int hw_id_get(char *buf, size_t buf_len)
{
Expand All @@ -53,7 +53,7 @@ int hw_id_get(char *buf, size_t buf_len)
addr.a.val[0]);
return 0;
}
#endif /* defined(CONFIG_HW_ID_LIBRARY_SOURCE_BLE_MAC) */
#endif /* defined(CONFIG_HW_ID_LIBRARY_SOURCE_BT_DEVICE_ADDRESS) */

#if defined(CONFIG_HW_ID_LIBRARY_SOURCE_DEVICE_ID)
/* Directly read Device ID from registers */
Expand Down
2 changes: 1 addition & 1 deletion samples/hw_id/overlay-ble-mac.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#
CONFIG_BT=y
CONFIG_HW_ID_LIBRARY_SOURCE_BLE_MAC=y
CONFIG_HW_ID_LIBRARY_SOURCE_BT_DEVICE_ADDRESS=y
2 changes: 1 addition & 1 deletion tests/lib/hw_id/src/kconfig_override_ble.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

#define CONFIG_HW_ID_LIBRARY_SOURCE_BLE_MAC y
#define CONFIG_HW_ID_LIBRARY_SOURCE_BT_DEVICE_ADDRESS y