client: Add support for user events

Also supporting configurable queue size for the internal event loop.

Closes https://github.com/espressif/esp-mqtt/issues/230
This commit is contained in:
David Cermak
2022-07-24 21:10:38 +02:00
parent 9186e5fa00
commit 97503cceb3
4 changed files with 77 additions and 4 deletions

View File

@@ -9,6 +9,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <stdatomic.h>
#include "esp_err.h"
#include "platform.h"
@@ -123,6 +124,9 @@ struct esp_mqtt_client {
EventGroupHandle_t status_bits;
SemaphoreHandle_t api_lock;
TaskHandle_t task_handle;
#if MQTT_EVENT_QUEUE_SIZE > 1
atomic_int queued_events;
#endif
};
bool esp_mqtt_set_if_config(char const *const new_config, char **old_config);