LoboMQ
Loading...
Searching...
No Matches
Broker.h
Go to the documentation of this file.
1
9#ifndef BROKER_H
10
11#define BROKER_H
12
13#include <freertos/FreeRTOS.h>
14#include <freertos/task.h>
15#include <vector>
16
17#include "commons/Includes.h"
18#include "PubSub.h"
19#include "MACAddrList.h"
20
21typedef struct {
22 SubscribeAnnouncement *subAnnounce;
23 const uint8_t *mac;
25
26typedef struct {
27 UnsubscribeAnnouncement *unsubAnnounce;
28 const uint8_t *mac;
30
31typedef struct {
32 PublishContent *pubContent;
33 const uint8_t *mac;
35
36#define BRO_DEFAULT_WHITELIST nullptr
37#define BRO_DEFAULT_LOGGER initializeSerialLogger(BROKER)
38#define BRO_DEFAULT_PERSISTENCE false
39#define BRO_DEFAULT_CS_SD_PIN -1
40
60LMQErrType initBroker(MACAddrList *whitelist = BRO_DEFAULT_WHITELIST, Elog *_logger = BRO_DEFAULT_LOGGER,
61 bool persistence = BRO_DEFAULT_PERSISTENCE, int csSdPin = BRO_DEFAULT_CS_SD_PIN);
62
63#endif
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.
Definition Broker.cpp:240
LMQErrType
Enumerates every error code that can be returned by the library functions.
Definition Includes.h:28
A class for managing a list of MAC addresses.
Definition MACAddrList.h:27
Structure that contains the fields used by a publish message, apart from those inherited from the Mes...
Definition PubSub.h:65
Structure that contains the fields used by a subscribe message, apart from those inherited from the M...
Definition PubSub.h:47
Structure that contains the fields used by a unsubscribe message, apart from those inherited from the...
Definition PubSub.h:56