|
LoboMQ
|
Go to the source code of this file.
Macros | |
| #define | SUBSCRIBETASKS 1 |
| #define | UNSUBSCRIBETASKS 1 |
| #define | PUBLISHTASKS 1 |
Functions | |
| void | SubscribeTask (void *parameter) |
| void | UnsubscribeTask (void *parameter) |
| void | PublishTask (void *parameter) |
| void | OnDataRecv (const uint8_t *mac, const uint8_t *incomingData, int len) |
| LMQErrType | initBroker (MACAddrList *whitelist, Elog *_logger, bool persistence, int csSdPin) |
| Initializes the broker. | |
Variables | |
| std::vector< BrokerTopic > | topicsVector |
| QueueHandle_t | subMsgQueue |
| QueueHandle_t | unsubMsgQueue |
| QueueHandle_t | pubMsgQueue |
| Elog * | logger |
| bool | gPersistence |
| int | gCsSdPin |
| SemaphoreHandle_t | mutex |
| MACAddrList * | gWhitelist |
This file contains the necessary logic to deploy a LoboMQ broker.
Definition in file Broker.cpp.
| #define PUBLISHTASKS 1 |
Definition at line 14 of file Broker.cpp.
| #define SUBSCRIBETASKS 1 |
Definition at line 12 of file Broker.cpp.
| #define UNSUBSCRIBETASKS 1 |
Definition at line 13 of file Broker.cpp.
| 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.
| void OnDataRecv | ( | const uint8_t * | mac, |
| const uint8_t * | incomingData, | ||
| int | len ) |
Definition at line 152 of file Broker.cpp.
| void PublishTask | ( | void * | parameter | ) |
Definition at line 119 of file Broker.cpp.
| void SubscribeTask | ( | void * | parameter | ) |
Definition at line 30 of file Broker.cpp.
| void UnsubscribeTask | ( | void * | parameter | ) |
Definition at line 76 of file Broker.cpp.
| int gCsSdPin |
Definition at line 25 of file Broker.cpp.
| bool gPersistence |
Definition at line 24 of file Broker.cpp.
| MACAddrList* gWhitelist |
Definition at line 28 of file Broker.cpp.
| Elog* logger |
Definition at line 23 of file Broker.cpp.
| SemaphoreHandle_t mutex |
Definition at line 26 of file Broker.cpp.
| QueueHandle_t pubMsgQueue |
Definition at line 21 of file Broker.cpp.
| QueueHandle_t subMsgQueue |
Definition at line 19 of file Broker.cpp.
| std::vector<BrokerTopic> topicsVector |
Definition at line 16 of file Broker.cpp.
| QueueHandle_t unsubMsgQueue |
Definition at line 20 of file Broker.cpp.