nRF Connect SDK API 0.1.0
Loading...
Searching...
No Matches
hw_id.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2022 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5 */
6
7#ifndef HW_ID_H__
8#define HW_ID_H__
9
10#include <zephyr/types.h>
11
18#ifdef __cplusplus
19extern "C" {
20#endif
21
22#if defined(CONFIG_HW_ID_LIBRARY_SOURCE_BLE_MAC)
23#define HW_ID_LEN (12 + 1)
24#elif defined(CONFIG_HW_ID_LIBRARY_SOURCE_DEVICE_ID)
25#define HW_ID_LEN (16 + 1)
26#elif defined(CONFIG_HW_ID_LIBRARY_SOURCE_UUID)
27#include <modem/modem_jwt.h>
28#define HW_ID_LEN (NRF_UUID_V4_STR_LEN + 1)
29#elif defined(CONFIG_HW_ID_LIBRARY_SOURCE_IMEI)
30#define HW_ID_LEN (15 + 1)
31#elif defined(CONFIG_HW_ID_LIBRARY_SOURCE_NET_MAC)
32#define HW_ID_LEN (12 + 1)
33#endif
34
44int hw_id_get(char *buf, size_t buf_len);
45
46#ifdef __cplusplus
47}
48#endif
49
52#endif /* HW_ID_H__ */
int hw_id_get(char *buf, size_t buf_len)
Fetch unique device ID.
Request a JWT from the modem.