diff --git a/drivers/hwinfo/hwinfo_esp32.c b/drivers/hwinfo/hwinfo_esp32.c index d8c76283715..6f30d86c2de 100644 --- a/drivers/hwinfo/hwinfo_esp32.c +++ b/drivers/hwinfo/hwinfo_esp32.c @@ -6,7 +6,7 @@ #include -#include +#include #include ssize_t _impl_hwinfo_get_device_id(u8_t *buffer, size_t length) diff --git a/drivers/hwinfo/hwinfo_handlers.c b/drivers/hwinfo/hwinfo_handlers.c index 7570e30dbee..c5e165444fc 100644 --- a/drivers/hwinfo/hwinfo_handlers.c +++ b/drivers/hwinfo/hwinfo_handlers.c @@ -5,7 +5,7 @@ */ #include -#include +#include Z_SYSCALL_HANDLER(hwinfo_get_device_id, buffer, length) { diff --git a/drivers/hwinfo/hwinfo_imxrt.c b/drivers/hwinfo/hwinfo_imxrt.c index b2ebdc9bcf4..453b3001f0d 100644 --- a/drivers/hwinfo/hwinfo_imxrt.c +++ b/drivers/hwinfo/hwinfo_imxrt.c @@ -5,7 +5,7 @@ */ #include -#include +#include #include struct imxrt_uid { diff --git a/drivers/hwinfo/hwinfo_mcux_sim.c b/drivers/hwinfo/hwinfo_mcux_sim.c index c775b3cabdc..db2d712768b 100644 --- a/drivers/hwinfo/hwinfo_mcux_sim.c +++ b/drivers/hwinfo/hwinfo_mcux_sim.c @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include +#include #include #include diff --git a/drivers/hwinfo/hwinfo_nrf.c b/drivers/hwinfo/hwinfo_nrf.c index 743f78ce057..d092f2a95ea 100644 --- a/drivers/hwinfo/hwinfo_nrf.c +++ b/drivers/hwinfo/hwinfo_nrf.c @@ -5,7 +5,7 @@ */ #include -#include +#include #include struct nrf_uid { diff --git a/drivers/hwinfo/hwinfo_sam.c b/drivers/hwinfo/hwinfo_sam.c index a2706b8ea44..ed5cb2c3b70 100644 --- a/drivers/hwinfo/hwinfo_sam.c +++ b/drivers/hwinfo/hwinfo_sam.c @@ -5,7 +5,7 @@ */ #include -#include +#include #include #include #include diff --git a/drivers/hwinfo/hwinfo_sam0.c b/drivers/hwinfo/hwinfo_sam0.c index 90308f1aea5..6afd600d52b 100644 --- a/drivers/hwinfo/hwinfo_sam0.c +++ b/drivers/hwinfo/hwinfo_sam0.c @@ -5,7 +5,7 @@ */ #include -#include +#include #include struct sam0_uid { diff --git a/drivers/hwinfo/hwinfo_shell.c b/drivers/hwinfo/hwinfo_shell.c index bfbf5f80d5a..5b3daba9bf7 100644 --- a/drivers/hwinfo/hwinfo_shell.c +++ b/drivers/hwinfo/hwinfo_shell.c @@ -6,7 +6,7 @@ #include #include -#include +#include #include #include diff --git a/drivers/hwinfo/hwinfo_stm32.c b/drivers/hwinfo/hwinfo_stm32.c index c7a7f55c481..388ab169d23 100644 --- a/drivers/hwinfo/hwinfo_stm32.c +++ b/drivers/hwinfo/hwinfo_stm32.c @@ -5,7 +5,7 @@ */ #include -#include +#include #include struct stm32_uid { diff --git a/drivers/hwinfo/hwinfo_weak_impl.c b/drivers/hwinfo/hwinfo_weak_impl.c index cbbde9e432c..fbc6fff36fc 100644 --- a/drivers/hwinfo/hwinfo_weak_impl.c +++ b/drivers/hwinfo/hwinfo_weak_impl.c @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include +#include ssize_t __weak z_impl_hwinfo_get_device_id(u8_t *buffer, size_t length) { diff --git a/include/drivers/hwinfo.h b/include/drivers/hwinfo.h new file mode 100644 index 00000000000..97238ce7971 --- /dev/null +++ b/include/drivers/hwinfo.h @@ -0,0 +1,58 @@ +/** + * @file + * + * @brief Public APIs to get device Information. + */ + +/* + * Copyright (c) 2018 Alexander Wachter + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef ZEPHYR_INCLUDE_DRIVERS_HWINFO_H_ +#define ZEPHYR_INCLUDE_DRIVERS_HWINFO_H_ + +#include +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Device ID + * @{ + */ + + +/** + * @brief Copy the device id to a buffer + * + * This routine copies "length" number of bytes of the device ID to the buffer. + * If the device ID is smaller then length, the rest of the buffer is left unchanged. + * The ID depends on the hardware and is not guaranteed unique. + * + * @param buffer Buffer to write the ID to. + * @param length Max length of the buffer. + * + * @retval size of the device ID copied or negative on error. + */ +__syscall ssize_t hwinfo_get_device_id(u8_t *buffer, size_t length); + +ssize_t z_impl_hwinfo_get_device_id(u8_t *buffer, size_t length); + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#include + +#endif /* ZEPHYR_INCLUDE_DRIVERS_HWINFO_H_ */ diff --git a/include/hwinfo.h b/include/hwinfo.h index 7f9e94c2260..99897894d18 100644 --- a/include/hwinfo.h +++ b/include/hwinfo.h @@ -1,58 +1,15 @@ -/** - * @file - * - * @brief Public APIs to get device Information. - */ - /* - * Copyright (c) 2018 Alexander Wachter + * Copyright (c) 2019 Intel Corporation * * SPDX-License-Identifier: Apache-2.0 */ - #ifndef ZEPHYR_INCLUDE_HWINFO_H_ #define ZEPHYR_INCLUDE_HWINFO_H_ -#include -#include -#include -#include -#include - -#ifdef __cplusplus -extern "C" { +#ifndef CONFIG_COMPAT_INCLUDES +#warning "This header file has moved, include instead." #endif -/** - * @brief Device ID - * @{ - */ - - -/** - * @brief Copy the device id to a buffer - * - * This routine copies "length" number of bytes of the device ID to the buffer. - * If the device ID is smaller then length, the rest of the buffer is left unchanged. - * The ID depends on the hardware and is not guaranteed unique. - * - * @param buffer Buffer to write the ID to. - * @param length Max length of the buffer. - * - * @retval size of the device ID copied or negative on error. - */ -__syscall ssize_t hwinfo_get_device_id(u8_t *buffer, size_t length); - -ssize_t z_impl_hwinfo_get_device_id(u8_t *buffer, size_t length); - -/** - * @} - */ - -#ifdef __cplusplus -} -#endif - -#include +#include #endif /* ZEPHYR_INCLUDE_HWINFO_H_ */ diff --git a/lib/updatehub/updatehub_device.h b/lib/updatehub/updatehub_device.h index bcedde9ffc9..502659152f6 100644 --- a/lib/updatehub/updatehub_device.h +++ b/lib/updatehub/updatehub_device.h @@ -8,7 +8,7 @@ #define __UPDATEHUB_DEVICE_H__ #include -#include +#include #define DEVICE_ID_MAX_SIZE 65 diff --git a/tests/drivers/hwinfo/api/src/main.c b/tests/drivers/hwinfo/api/src/main.c index 26864657899..bd5ed7edc05 100644 --- a/tests/drivers/hwinfo/api/src/main.c +++ b/tests/drivers/hwinfo/api/src/main.c @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: Apache-2.0 */ -#include +#include #include #include #include