LoboMQ
|
#include <freertos/FreeRTOS.h>
#include <freertos/task.h>
#include <vector>
#include "commons/Includes.h"
#include "PubSub.h"
#include "MACAddrList.h"
Go to the source code of this file.
Classes | |
struct | SubscribeTaskParams |
struct | UnsubscribeTaskParams |
struct | PublishTaskParams |
Macros | |
#define | BRO_DEFAULT_WHITELIST nullptr |
#define | BRO_DEFAULT_LOGGER initializeSerialLogger(BROKER) |
#define | BRO_DEFAULT_PERSISTENCE false |
#define | BRO_DEFAULT_CS_SD_PIN -1 |
Functions | |
LMQErrType | initBroker (MACAddrList *whitelist=BRO_DEFAULT_WHITELIST, Elog *_logger=BRO_DEFAULT_LOGGER, bool persistence=BRO_DEFAULT_PERSISTENCE, int csSdPin=BRO_DEFAULT_CS_SD_PIN) |
Initializes the broker. | |
This file contains the necessary definitions and declarations to deploy a LoboMQ broker.
Definition in file Broker.h.
#define BRO_DEFAULT_LOGGER initializeSerialLogger(BROKER) |
LMQErrType initBroker | ( | MACAddrList * | whitelist = BRO_DEFAULT_WHITELIST, |
Elog * | _logger = BRO_DEFAULT_LOGGER, | ||
bool | persistence = BRO_DEFAULT_PERSISTENCE, | ||
int | csSdPin = BRO_DEFAULT_CS_SD_PIN ) |
Initializes the broker.
This function sets up the proper tasks and queues to handle received message and gives a node the role of broker. This broker redirects published messages to the subscribers. If persistence is enabled, topics will be restored on boot and stored in the SD card.
whitelist | List with the allowed MAC addresses. If is BRO_DEFAULT_WHITELIST , all MAC addresses are allowed. |
_logger | Pointer to the logger object. |
persistence | If is true , the broker will save the topics in a SD card. |
csSdPin | The Chip Select pin of the SD card module. |
`LMQ_ERR_SUCCESS` | if the broker is successfully deployed. |
`LMQ_ERR_BAD_ESP_CONFIG` | if ESP-NOW couldn't be initialized. |
`LMQ_ERR_XQUEUECREATE_FAIL` | if the message queues for the tasks couldn't be created. |
`LMQ_ERR_XTASKCREATE_FAIL` | if the tasks to process the messages couldn't be created. |
Definition at line 240 of file Broker.cpp.