feat(mosq): Add support for on-message callback

This commit is contained in:
David Cermak
2024-12-19 16:36:51 +01:00
parent 6cce87e465
commit cdeab8f517
3 changed files with 15 additions and 0 deletions

View File

@@ -9,6 +9,7 @@
struct mosquitto__config;
typedef void (*mosq_message_cb_t)(char *client, char *topic, char *data, int len, int qos, int retain);
/**
* @brief Mosquitto configuration structure
*
@@ -24,6 +25,10 @@ struct mosq_broker_config {
* You can open the respective docs with this idf.py command:
* `idf.py docs -sp api-reference/protocols/esp_tls.html`
*/
void (*handle_message_cb)(char *client, char *topic, char *data, int len, int qos, int retain); /*!<
* On message callback. If configured, user function is called
* whenever mosquitto processes a message.
*/
};
/**