From f2e3acec45222a7996301f43b1678bbcf9dd34a6 Mon Sep 17 00:00:00 2001 From: Pawel Dunaj Date: Mon, 9 Dec 2024 12:40:35 +0100 Subject: [PATCH] applications: nrf_desktop: fix c++ compatibility in util headers Make util headers includable from a c++ code. Signed-off-by: Pawel Dunaj --- .../nrf_desktop/src/util/config_channel_transport.h | 8 ++++++++ applications/nrf_desktop/src/util/dfu_lock.h | 8 ++++++++ applications/nrf_desktop/src/util/hwid.h | 8 ++++++++ 3 files changed, 24 insertions(+) diff --git a/applications/nrf_desktop/src/util/config_channel_transport.h b/applications/nrf_desktop/src/util/config_channel_transport.h index bb6ec74d109b..19e8a7c1636b 100644 --- a/applications/nrf_desktop/src/util/config_channel_transport.h +++ b/applications/nrf_desktop/src/util/config_channel_transport.h @@ -16,6 +16,10 @@ #include "config_event.h" +#ifdef __cplusplus +extern "C" { +#endif + /** * @brief Parse the configuration channel report. * @@ -130,6 +134,10 @@ bool config_channel_transport_rsp_receive(struct config_channel_transport *trans */ void config_channel_transport_disconnect(struct config_channel_transport *transport); +#ifdef __cplusplus +} +#endif + /** * @} */ diff --git a/applications/nrf_desktop/src/util/dfu_lock.h b/applications/nrf_desktop/src/util/dfu_lock.h index 94271659ebf9..e28ef8654c7f 100644 --- a/applications/nrf_desktop/src/util/dfu_lock.h +++ b/applications/nrf_desktop/src/util/dfu_lock.h @@ -16,6 +16,10 @@ * @{ */ +#ifdef __cplusplus +extern "C" { +#endif + /** @brief DFU lock owner descriptor. */ struct dfu_lock_owner { /** Owner name. */ @@ -69,6 +73,10 @@ int dfu_lock_claim(const struct dfu_lock_owner *new_owner); */ int dfu_lock_release(const struct dfu_lock_owner *owner); +#ifdef __cplusplus +} +#endif + /** * @} */ diff --git a/applications/nrf_desktop/src/util/hwid.h b/applications/nrf_desktop/src/util/hwid.h index 9f753e4cccfd..75fde6d5af9e 100644 --- a/applications/nrf_desktop/src/util/hwid.h +++ b/applications/nrf_desktop/src/util/hwid.h @@ -7,8 +7,16 @@ #ifndef _HWID_H_ #define _HWID_H_ +#ifdef __cplusplus +extern "C" { +#endif + #define HWID_LEN 8 void hwid_get(uint8_t *buf, size_t buf_size); +#ifdef __cplusplus +} +#endif + #endif /* _HWID_H_ */