17#define MAXTOPICLENGTH 24
18#define MAXCONTENTSIZE 30
25typedef enum __attribute__((packed)) {
48 char topic[MAXTOPICLENGTH];
57 char topic[MAXTOPICLENGTH];
66 char topic[MAXTOPICLENGTH];
68 void* content[MAXCONTENTSIZE];
149 void* content[MAXCONTENTSIZE];
LMQErrType
Enumerates every error code that can be returned by the library functions.
Elog * disableLogger()
Creates a logger without the ability to print messages.
LMQErrType subscribe(uint8_t *mac, char *topic, Elog *_logger=disableLogger())
Subscribes to a topic on the broker.
LMQErrType unsubscribe(uint8_t *mac, char *topic, Elog *_logger=disableLogger())
Unsubscribes from a topic on the broker.
LMQErrType publish(uint8_t *mac, char *topic, void *payload, size_t payloadSize, Elog *_logger=disableLogger())
Publishes a message to the broker.
MessageType
Enumerates every type of message sent between the broker and the clients.
@ MSGTYPE_UNSUBSCRIBE
Unsubscribe message, sent from subscriber to broker.
@ MSGTYPE_PUBLISH
Publish message, sent from publisher to broker or from broker to subscriber.
@ MSGTYPE_SUBSCRIBE
Subscribe message, sent from subscriber to broker.
PayloadContent getLMQPayload(const uint8_t *incomingData)
Gets the payload content inside a published message This function extracts the payload from the bytes...
bool isLMQMessage(const uint8_t *incomingData)
Checks if the data received is a MQ message.
Structure that contains the fields used by every message.
Structure representing the content of a payload This structure holds properties of the content receiv...
size_t contentSize
Size of the content.
Structure that contains the fields used by a publish message, apart from those inherited from the Mes...
size_t contentSize
Size of the content.
Structure that contains the fields used by a subscribe message, apart from those inherited from the M...
Structure that contains the fields used by a unsubscribe message, apart from those inherited from the...