From e11e1136e163878d8a80219ae3b947566baa3559 Mon Sep 17 00:00:00 2001 From: 0xFEEDC0DE64 Date: Wed, 4 Jun 2025 12:40:47 +0200 Subject: [PATCH] fix(mosquitto) make mosquitto component c++ compatible --- components/mosquitto/port/include/mosq_broker.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/components/mosquitto/port/include/mosq_broker.h b/components/mosquitto/port/include/mosq_broker.h index d9b858b8c..e7768f48b 100644 --- a/components/mosquitto/port/include/mosq_broker.h +++ b/components/mosquitto/port/include/mosq_broker.h @@ -4,6 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#ifdef __cplusplus +extern "C" { +#endif #include "mosquitto.h" #include "esp_tls.h" @@ -17,7 +20,7 @@ typedef void (*mosq_message_cb_t)(char *client, char *topic, char *data, int len * structure. */ struct mosq_broker_config { - char *host; /*!< Address on which the broker is listening for connections */ + const char *host; /*!< Address on which the broker is listening for connections */ int port; /*!< Port number of the broker to listen to */ esp_tls_cfg_server_t *tls_cfg; /*!< ESP-TLS configuration (if TLS transport used) * Please refer to the ESP-TLS official documentation @@ -48,3 +51,7 @@ int mosq_broker_run(struct mosq_broker_config *config); * @note After calling this API, function mosq_broker_run() unblocks and returns. */ void mosq_broker_stop(void); + +#ifdef __cplusplus +} +#endif