support for custom implementation of msg outbox

This commit is contained in:
David Cermak
2018-08-15 17:24:46 +02:00
parent fa7ade77b1
commit 0c25441fdd
7 changed files with 56 additions and 40 deletions

View File

@@ -4,8 +4,25 @@
#include "rom/queue.h"
#include "esp_log.h"
#ifndef CONFIG_MQTT_CUSTOM_OUTBOX
static const char *TAG = "OUTBOX";
typedef struct outbox_item {
char *buffer;
int len;
int msg_id;
int msg_type;
int tick;
int retry_count;
bool pending;
STAILQ_ENTRY(outbox_item) next;
} outbox_item_t;
STAILQ_HEAD(outbox_list_t, outbox_item);
outbox_handle_t outbox_init()
{
outbox_handle_t outbox = calloc(1, sizeof(struct outbox_list_t));
@@ -149,3 +166,5 @@ void outbox_destroy(outbox_handle_t outbox)
outbox_cleanup(outbox, 0);
free(outbox);
}
#endif /* CONFIG_MQTT_CUSTOM_OUTBOX */