13#include <mqtt/msg_types.h>
14#include <mqtt/mqtt_msg_reqs.h>
18#ifdef NB_SSL_SUPPORTED
19#include <crypto/NetBurner/NbSslCtx.h>
48#define MQTT_WAIT (TICKS_PER_SECOND*10)
49#define MQTT_TLS_NEGOTIATE_TIMEOUT (TICKS_PER_SECOND*50)
51#define MQTT_OBJ_PRIORITY_COUNT (16)
52#define MQTT_OBJ_PRIORITY_MAX 0
53#define MQTT_OBJ_PRIORITY_MIN 15
55#define MQTT_MAX_PKT_SIZE (0x2FFFFFFF)
56#define MQTT_MAX_MAX_SUPPORTED_IN_FLIGHT (256)
57#define MQTT_MAX_SUPPORTED_IN_FLIGHT (16)
58#define MQTT_MAX_HANDLERS_PER_CONNECTION (256)
59#define MQTT_MAX_SUPPORTED_RX_TOPIC_ALIASES (128)
60#define MQTT_DEFAULT_SESSION_EXPIRY_INTERVAL (3600)
61#define MQTT_DEFAULT_KEEP_ALIVE (30)
63#define MQTT_MAX_SUB_IDs (128)
164#include <mqtt/mqtt_internal.h>
165#include <mqtt/config_mqtt_obj.h>
243#define MqttEndMarker \
244 virtual int Missing_ConfigEndMarker(void *&startp) override \
247 return sizeof(*this); \
264 friend void ::UserMain(
void *pd);
305 eConnStat_Disconnected,
314 typedef leaf_list_t leaf_queue_t;
316 static Client *s_clients;
317 static Client *s_clientsTail;
321 void dequeue_active(mqtt_leaf **ppNextReq,
int activeQueue,
322 uint32_t &waiting, leaf_queue_t *q);
335#ifdef NB_SSL_SUPPORTED
344 uint32_t pubQueueWaiting;
345 uint32_t subQueueWaiting;
349 PublishRequest nextPubReq;
350 AckCbCtx nextSubAckCtx;
359 inline bool ReadyToSend()
361 return mSess.txNeedSpace || pubQueueWaiting || subQueueWaiting
362 || mSess.pubReqQueueWaiting || mSess.subReqQueue.head;
366 ConnectRequest connReq;
367 PublishRequest lwtMsg;
369 internal::Session mSess;
370 void initSessionInfo(
const ParsedURI &brokerURI,
bool bCleanStart, uint16_t maxKeepAlive, PublishRequest *pLwtMsg, RequestProperty *addProps);
371 virtual internal::eClientState_t SetState_Rx(internal::eClientState_t newState);
372 virtual internal::eClientState_t SetState_Tx(internal::eClientState_t newState);
374 void RegisterClient();
375 void DeregisterClient();
377 void InterpolateLeafTopics();
379 void readyConnMsgsFromConfig(config_MqttClient &clientCfg,
380 config_MqttLWT *lwtCfg, RequestProperty *addProps);
381 Client(config_MqttClient &clientCfg,
382 config_MqttLWT *lwtCfg = NULL, RequestProperty *addProps = NULL,
383 bool ConnectOnStartup =
true);
402 const char *pConnMsg = NULL,
const char *pDisconnMsg = NULL,
403 const char *pUsername = NULL,
const char *pPassword = NULL,
404 RequestProperty *addProps = NULL,
bool ConnectOnStartup =
true);
422 const char *pConnMsg = NULL,
const char *pDisconnMsg = NULL,
423 const char *pUsername = NULL,
const char *pPassword = NULL,
424 RequestProperty *addProps = NULL,
bool ConnectOnStartup =
true);
436 int Connect(
bool bWaitForConnection,
const char *pNewBrokerURI,
437 ConnAckCb_t notifyCb = NULL,
void *notifyCtx = NULL);
450 ConnAckCb_t notifyCb = NULL,
void *notifyCtx = NULL);
545 inline void SetClientCert(uint8_t *cert, uint32_t len, uint8_t *privkey, uint32_t privlen)
547#ifdef NB_SSL_SUPPORTED
551 privKeyLen = privlen;
566 inline void GetClientCert(uint8_t **cert, uint32_t *len, uint8_t **privkey, uint32_t *privlen)
568#ifdef NB_SSL_SUPPORTED
572 *privlen = privKeyLen;
638 int Publish(
const char *topic, uint8_t *pData, uint32_t len,
int prio,
TickTimeout &t, uint8_t qos = 0);
825 int AddToSelectSet(fd_set &rd_set, fd_set &wr_set, fd_set &er_set);
826 TickTimeout ProcessSelectResult(fd_set &rd_set, fd_set &wr_set, fd_set &er_set);
828 const ParsedURI & getBrokerURI() {
return broker; }
831 static volatile OS_TCB *TaskTcb;
833 static OS_SEM s_TaskWakeSem;
834 static void Task(
void *);
835 friend class internal::WrCritObj;
836 friend struct internal::Session;
862 config_MqttLWT clientCfgLWT{*
this,
"LWT",
"Last Will and Testament message configuration"};
864#ifdef NB_SSL_SUPPORTED
867 void init(RequestProperty *addProps);
869 virtual internal::eClientState_t SetState_Tx(internal::eClientState_t newState)
override;
881 const char *desc =
"Mqtt client connection configuration",
882 RequestProperty *addProps = NULL,
bool ConnectOnStartup =
true);
884 virtual void CommitTestedValue(uint32_t permission_mask)
override;
893typedef void(LeafCallBack)(
mqtt_leaf *p,
void *pextra);
911 eObj_State_PubReady = 0x00,
912 eObj_State_PubPendTimer = 0x01,
913 eObj_State_PubQueued = 0x02,
914 eObj_State_PubNeedAck = 0x03,
916 eObj_State_SubNone = 0x00,
917 eObj_State_SubSendSub = 0x10,
918 eObj_State_SubNeedAck = 0x20,
919 eObj_State_SubReady = 0x30,
920 eObj_State_SubSendUnsub = 0x40,
921 eObj_State_SubUnsubNeedAck = 0x50,
923 eObj_State_PubState_MASK = 0x0F,
924 eObj_State_SubState_MASK = 0xF0,
939 uint16_t subHandlerId;
943 static OS_CRIT s_needClientCrit;
1072 uint8_t
PubState() {
return state & eObj_State_PubState_MASK; }
1079 uint8_t
SubState() {
return state & eObj_State_SubState_MASK; }
1307 virtual void TimeElementEvent()
override;
1309 virtual int Missing_ConfigEndMarker(
void *&startp) = 0;
1311 struct leaf_queue_t {
1315 static int puback_cb(
Client *mSess,
void *ctx, PacketInfo::PublishAck *ack);
1316 static int suback_cb(
Client *mSess,
void *ctx, PacketInfo::PublishAck *ack);
1318 static void dequeue_active(
mqtt_leaf **ppNextReq,
int activeQueue,
1319 uint32_t &waiting, leaf_queue_t *q);
1322 friend void mqttParseFd(
mqtt_leaf *pl,
void *pd);
1440 virtual int Missing_ConfigEndMarker(
void *&startp)
override
1443 return sizeof(*this);
1551 inline operator int()
const {
return val; }
1617 virtual int Missing_ConfigEndMarker(
void *&startp)
override
1620 return sizeof(*this);
1695 inline operator unsigned()
const {
return val; }
1760 virtual int Missing_ConfigEndMarker(
void *&startp)
override
1763 return sizeof(*this);
1774 uint8_t serPrecision;
1840 inline operator double()
const {
return val; }
1861 serStrFormat = formatChar;
1866 serPrecision = precision;
1908 virtual int Missing_ConfigEndMarker(
void *&startp)
override
1911 return sizeof(*this);
2021 inline const char operator[](
size_t pos)
const {
return val[pos]; }
2068 virtual int Missing_ConfigEndMarker(
void *&startp)
override
2071 return sizeof(*this);
2146 inline operator bool()
const {
return val; }
2194 virtual int Missing_ConfigEndMarker(
void *&startp)
override
2197 return sizeof(*this);
2279 inline operator bool() {
return pin; }
2343 using mqtt_IO::operator=;
2375 using mqtt_IO::operator=;
2417 config_leaf *pendingPubLeaf;
2419 uint32_t renderFlags;
2441 ConfigExposer(config_leaf &leaf,
const char *topicRoot,
Client *mClient = NULL, uint16_t initFlags = 0, uint32_t renderFlags = 0);
2520 virtual int Missing_ConfigEndMarker(
void *&startp)
override
2523 return sizeof(*this);
2527typedef int (*SubHandlerCb)(
int mqttFd,
const char *pathExt, uint32_t msgLen);
2534 SubHandlerCb handler;
2578 SubHandler(SubHandlerCb handler,
const char * topicFilter,
Client *mClient = NULL, uint16_t flags = 0);
2606 uint32_t markers[8];
2610 : markers{0,0,0,0,0,0,0,0}, num(0)
2614 PropMarker(uint32_t val_0, uint32_t val_1, uint32_t val_2, uint32_t val_3,
2615 uint32_t val_4, uint32_t val_5, uint32_t val_6, uint32_t val_7)
2616 : markers{val_0, val_1, val_2, val_3, val_4, val_5, val_6, val_7}, num(0)
2618 for (
int i = 0; i < 8; i++)
2619 for (uint32_t v = 1; v; v <<= 1)
2624 inline void reset() {
for(
int i = 0; i < 8; i++) markers[i] = 0; }
2626 inline void set(
int prop)
2629 num += ((markers[prop>>5] & (1UL << (prop&0x1F))) == 0);
2630 markers[prop>>5] |= 1UL << (prop&0x1F);
2632 inline void clr(
int prop)
2635 num -= ((markers[prop>>5] & (1UL << (prop&0x1F))) != 0);
2636 markers[prop>>5] &= ~(1UL << (prop&0x1F));
2638 inline bool isset(
int prop) { prop--;
return ((markers[prop>>5] & (1UL << (prop&0x1F))) != 0); }
2639 inline int count() {
return num; }
Advanced low-level MQTT Client for interacting with Mqtt Brokers. The client handles all network comm...
Definition mqtt.h:263
int Unsubscribe(const char *topicFilter, TickTimeout &t)
Unsubscribe and deregister a TopicHandler.
int RemoveTopicHandler(int handlerIdx)
Remove/deregister a TopicHandler from the Client by index.
static void StartTask(uint8_t taskPrio=MQTT_TASK_PRIO)
Start the Client Task.
int Subscribe(TopicHandler &handler, int *handlerIdx, TickTimeout &t, uint8_t subOpts=Pkt::eSubOpt_NoLocal)
Register a TopicHandler and subscribe its Topic on the Broker.
eConnectionStatus GetConnectionStatus()
Get the current state of the Client's connection to the Broker.
eConnectionStatus
Connection state values.
Definition mqtt.h:298
@ eConnStat_InProgress
Connection to broker in progress.
Definition mqtt.h:302
@ eConnStat_No_Broker_Configured
Error, no broker configured to be used.
Definition mqtt.h:300
@ eConnStat_Refused
Connection refused by broker.
Definition mqtt.h:304
@ eConnStat_Error
General error with client connection.
Definition mqtt.h:299
@ eConnStat_Established
Connection with broker established.
Definition mqtt.h:303
@ eConnStat_Resolving
Currently resolving broker address.
Definition mqtt.h:301
void RegisterMqttObj(mqtt_leaf &leaf, uint32_t interval=0)
Register an MqttObj with the Client.
eRateLimitAdjustMethod
How to adjust rate limit buckets when modifying the current rate limit.
Definition mqtt.h:289
@ eRateLimitAdj_Add
Add the adjustment value to the current token count.
Definition mqtt.h:292
@ eRateLimitAdj_Subtract
Subtract the adjustment value from the current token count.
Definition mqtt.h:293
@ eRateLimitAdj_Set
Set the current limit token count to the adjustment value.
Definition mqtt.h:291
@ eRateLimitAdj_None
Do not modify the current limit token count.
Definition mqtt.h:290
Client(const char *brokerURI, const char *pClientId, uint16_t maxKeepAlive=MQTT_DEFAULT_KEEP_ALIVE, bool bCleanStart=true, PublishRequest *lwtMsg=NULL, const char *pConnMsg=NULL, const char *pDisconnMsg=NULL, const char *pUsername=NULL, const char *pPassword=NULL, RequestProperty *addProps=NULL, bool ConnectOnStartup=true)
Constructor. This version takes a raw string for the broker URI.
int SendNextSubReq()
Send the next queued SubUnSub Request.
static Client * GetFirstClient()
Start the Client Task.
Definition mqtt.h:851
int RemoveTopicHandler(TopicHandler *handler)
Remove/deregister a TopicHandler from the Client by reference.
void SetConnectNotify(ConnAckCb_t notifyCb, void *notifyCtx)
Set the connection notification callback and it's context information.
void SetClientCert(uint8_t *cert, uint32_t len, uint8_t *privkey, uint32_t privlen)
Set the Client Certificate and Private Key to use when connecting to a Broker via TLS.
Definition mqtt.h:545
int QueueSubscribe(SubUnsubQueueMsg *qmsg)
Register a TopicHandler and subscribe its Topic on the Broker.
void RemoveObj(mqtt_leaf &leaf)
Deregister/remove an MqttObj from the Client.
int QueueUnsubscribe(SubUnsubQueueMsg *qmsg)
Queue unsubscribing and deregistering a TopicHandler.
int QueuePublish(mqtt_leaf &leaf)
Queue an MqttObj to be published.
int QueueSubscribe(mqtt_leaf &leaf)
Queue an MqttObj to subscribe.
eRateLimitType
Rate limit types for Client messaging.
Definition mqtt.h:282
@ eRateLimit_Subscribe
Limit for Subscribe requests per second.
Definition mqtt.h:284
@ eRateLimit_Publish
Limit for Publish requests per second.
Definition mqtt.h:283
int QueueAllSubscriptions()
Queue all Client's registered MqttObjs to be subscribed and published according to the object's opera...
Client(const ParsedURI *brokerURI, const char *pClientId, uint16_t maxKeepAlive=MQTT_DEFAULT_KEEP_ALIVE, bool bCleanStart=true, PublishRequest *lwtMsg=NULL, const char *pConnMsg=NULL, const char *pDisconnMsg=NULL, const char *pUsername=NULL, const char *pPassword=NULL, RequestProperty *addProps=NULL, bool ConnectOnStartup=true)
Constructor. This version takes a ParsedURI object for the broker URI.
int Unsubscribe(int handlerIdx, TickTimeout &t, const char *topicFilter=NULL)
Unsubscribe and deregister a TopicHandler.
int Subscribe(SubscribeRequest *req, int *handlerIdx, TickTimeout &t)
Register a TopicHandler (via fully specified SubscribeRequest) and subscribe its Topic on the Broker.
int QueuePublish(PublishRequest *req, int *prio)
Queue a publish message from a fully defined request.
int Publish(PublishRequest *req, int prio, TickTimeout &t)
Publish a fully defined request.
int SetRateLimit(eRateLimitType type, uint8_t bucketMax, uint8_t fillCount, uint8_t fillTicks, eRateLimitAdjustMethod adjMethod, uint8_t adjCount)
Set the value for a given rate limit.
int RegisterTopicHandler(TopicHandler *newHandler, int *handlerIdx)
Register a TopicHandler with the Client.
int Connect(bool bWaitForConnection, const char *pNewBrokerURI, ConnAckCb_t notifyCb=NULL, void *notifyCtx=NULL)
Begin the process of Connecting the client to the Broker.
int Disconnect()
Disconnect the Client from the Broker.
int SendNextPubReq()
Send the next queued Publish Request.
int SetRateLimit_Publish(int reqPerSecond)
Set the Publish rate limit. This method automatically determines the fillCount and fillTicks to use f...
int QueueUnsubscribe(mqtt_leaf &leaf)
Queue an MqttObj to unsubscribe.
int Publish(const char *topic, uint8_t *pData, uint32_t len, int prio, TickTimeout &t, uint8_t qos=0)
Publish a binary payload message.
eSessionLimit
Limit types for the Client interactions with the Broker.
Definition mqtt.h:268
@ eLimit_SubAliases
Maximum number of subscription aliases.
Definition mqtt.h:274
@ eLimit_InFlight_Rx
Maximum number of outstanding rx messages with QoS > 0.
Definition mqtt.h:272
@ eLimit_Size_Rx
Maximum transmit message size allowed.
Definition mqtt.h:270
@ eLimit_Subscriptions
Maximum number of topic subscriptions.
Definition mqtt.h:273
@ eLimit_QoS
Maximum QoS for messages.
Definition mqtt.h:276
@ eLimit_PublishAliases
Maximum number of Publish topic name aliases.
Definition mqtt.h:275
@ eLimit_Size_Tx
Maximum receive message size accepted.
Definition mqtt.h:269
@ eLimit_InFlight_Tx
Maximum number of outstanding tx messages with QoS > 0.
Definition mqtt.h:271
@ eLimit_SessionExpirary
Maximum time for Session before expiring.
Definition mqtt.h:277
int Connect(bool bWaitForConnection=true, const ParsedURI *pNewBrokerURI=NULL, ConnAckCb_t notifyCb=NULL, void *notifyCtx=NULL)
Begin the process of Connecting the client to the Broker.
int Publish(const char *topic, const char *pStr, int prio, TickTimeout &t, uint8_t qos=0)
Publish a message.
void GetClientCert(uint8_t **cert, uint32_t *len, uint8_t **privkey, uint32_t *privlen)
Set the Client Certificate and Private Key to use when connecting to a Broker via TLS.
Definition mqtt.h:566
int SetRateLimit_Subscribe(int reqPerSecond)
Set the Subscribe rate limit. This method automatically determines the fillCount and fillTicks to use...
Easy MqttObj class for automatically publishing and subscribing NetBurner Config system objects to/fr...
Definition mqtt.h:2405
virtual int GetSubTopicFilter(NBString &s) override
Get the Subscription Topic Filter this object Subscribes to.
virtual int SubscribeEvent(int mqttFd, PacketInfo::Msg *msg) override
Handle a message sent by the Broker triggered by this object's Subscription.
virtual int RenderToFd(eObj_Serialize_t form, int fd) override
Render this object to an output socket.
virtual int ParseFd(int mqttFd) override
Parse the data from a file descriptor according to this object's current default serialization method...
ConfigExposer(config_leaf &leaf, const char *topicRoot, Client *mClient=NULL, uint16_t initFlags=0, uint32_t renderFlags=0)
Constructor for a standalone ConfigExposer object.
virtual int GetRenderLength(eObj_Serialize_t form=eObj_Serialize_CURRENT_FORM) override
the number of bytes used to serialize this object in a particular format.
virtual int GetPubTopicName(NBString &s) override
Get the Topic Name this object Publishes to.
ConfigExposer(mqtt_leaf &parent, config_leaf &leaf, const char *topicRoot, Client *mClient=NULL, uint16_t initFlags=0, uint32_t renderFlags=0)
Constructor for a ConfigExposer object that has a parent.
virtual ValueTestResult TestOrSetValue(ParsedJsonDataSet &pjs, bool setVal) override
whether the current index of a JSON dataset is valid for this object, or assign the value at the curr...
eRenderFlag_t
Rendering options for MQTT output of Config objects.
Definition mqtt.h:2410
@ eRender_ModifiedOnly
Only render modified leaves of the branch.
Definition mqtt.h:2412
@ eRender_Hidden
Hide this branch from renders of the object.
Definition mqtt.h:2411
@ eRender_Pretty
Do Pretty Print rendering.
Definition mqtt.h:2413
virtual int RenderToBuffer(eObj_Serialize_t form, uint8_t *buf, int buflen) override
Render this object to an output buffer.
Easy class for registering a callback function that receives messages on an MQTT topic and handles th...
Definition mqtt.h:2533
virtual int ParseFd(int mqttFd) override
SubHandler::ParseFd Parse the data from a file descriptor according to this object's current default ...
SubHandler(SubHandlerCb handler, const char *topicFilter, Client *mClient=NULL, uint16_t flags=0)
SubHandler Constructor for a standalone SubHandler object.
virtual ValueTestResult TestOrSetValue(ParsedJsonDataSet &pjs, bool setVal) override
SubHandler::TestOrSetValue Test whether the current index of a JSON dataset is valid for this object,...
virtual int RenderToFd(eObj_Serialize_t form, int fd) override
SubHandler::RenderToFd Render this object to an output socket.
virtual int SubscribeEvent(int mqttFd, PacketInfo::Msg *msg) override
SubHandler::SubscribeEvent Handle a message sent by the Broker triggered by this object's Subscriptio...
virtual int RenderToBuffer(eObj_Serialize_t form, uint8_t *buf, int buflen) override
SubHandler::RenderToBuffer Render this object to an output buffer.
MqttObj connecting hardware GPIO pins to an Mqtt Broker. This class defaults the pin to an Output sta...
Definition mqtt.h:2373
mqtt_IO_Output(PinIO ioPin, const char *topic, Client *client=NULL, uint16_t flags=0)
Constructor for a standalone mqtt_IO_Output object.
Definition mqtt.h:2384
mqtt_IO_Output(mqtt_leaf &parent, PinIO ioPin, const char *topic, Client *client=NULL, uint16_t flags=0)
Constructor for a mqtt_IO_Output object that has a parent.
Definition mqtt.h:2396
Easy MqttObj class for automatically publishing and subscribing hardware GPIO pins to/from an MQTT to...
Definition mqtt.h:2205
virtual ValueTestResult TestOrSetValue(ParsedJsonDataSet &pjs, bool setVal) override
whether the current index of a JSON dataset is valid for this object, or assign the value at the curr...
virtual int RenderToFd(eObj_Serialize_t form, int fd) override
Render this object to an output socket.
mqtt_IO(mqtt_leaf &parent, PinIO ioPin, const char *topic, Client *mClient=NULL, uint16_t flags=(eObj_Flag_PubOnWrite|eObj_Flag_Subscribe|eObj_Flag_Sub_NoLocal))
Constructor for a mqtt_IO object that has a parent.
int SetFixedDirection(int direction)
Set a fixed direction for the GPIO pin.
virtual void ClearFlags(uint16_t delFlags) override
behavioral flags from this object
static void PinNotify(int port_num, int pin, void *ctx)
Static notification function for pin state changes.
mqtt_IO & operator=(bool val)
Assignment operator for mqtt_IO. Assigns the value to the hardware GPIO, then performs any post assig...
virtual int SubscribeEvent(int mqttFd, PacketInfo::Msg *msg) override
Handle a message sent by the Broker triggered by this object's Subscription.
virtual int ParseFd(int mqttFd) override
the data from a file descriptor according to this object's current default serialization method and a...
bool operator!()
Boolean Not operator for mqtt_IO. Returns the negation of the current state of the underlying GPIO.
Definition mqtt.h:2286
virtual void SetFlags(uint16_t newFlags) override
additional behavioral flags for this object
mqtt_IO(PinIO ioPin, const char *topic, Client *mClient=NULL, uint16_t flags=(eObj_Flag_PubOnWrite|eObj_Flag_Subscribe|eObj_Flag_Sub_NoLocal))
Constructor for a standalone mqtt_IO object.
virtual int RenderToBuffer(eObj_Serialize_t form, uint8_t *buf, int buflen) override
Render this object to an output buffer.
Easy MqttObj class for automatically publishing and subscribing boolean values to/from an MQTT topic....
Definition mqtt.h:2079
bool operator!() const
Boolean Not operator for mqtt_bool. Returns the negated value of the object as an boolean.
Definition mqtt.h:2153
mqtt_bool(const char *topic, Client *mClient=NULL, uint16_t flags=(eObj_Flag_PubOnWrite|eObj_Flag_Subscribe|eObj_Flag_Sub_NoLocal))
Constructor for a standalone mqtt_bool object.
virtual int ParseFd(int mqttFd) override
the data from a file descriptor according to this object's current default serialization method and a...
virtual int RenderToFd(eObj_Serialize_t form, int fd) override
Render this object to an output socket.
virtual ValueTestResult TestOrSetValue(ParsedJsonDataSet &pjs, bool setVal) override
whether the current index of a JSON dataset is valid for this object, or assign the value at the curr...
mqtt_bool(bool val, const char *topic, Client *mClient=NULL, uint16_t flags=(eObj_Flag_PubOnWrite|eObj_Flag_Subscribe|eObj_Flag_Sub_NoLocal))
Constructor for a standalone mqtt_bool object.
mqtt_bool & operator=(bool i)
Assignment operator for mqtt_bool. Assigns the value to the object, then performs any post assignment...
mqtt_bool(mqtt_leaf &parent, bool val, const char *topic, Client *mClient=NULL, uint16_t flags=(eObj_Flag_PubOnWrite|eObj_Flag_Subscribe|eObj_Flag_Sub_NoLocal))
Constructor for a mqtt_bool object that has a parent.
virtual int SubscribeEvent(int mqttFd, PacketInfo::Msg *msg) override
Handle a message sent by the Broker triggered by this object's Subscription.
virtual int RenderToBuffer(eObj_Serialize_t form, uint8_t *buf, int buflen) override
Render this object to an output buffer.
mqtt_bool(mqtt_leaf &parent, const char *topic, Client *mClient=NULL, uint16_t flags=(eObj_Flag_PubOnWrite|eObj_Flag_Subscribe|eObj_Flag_Sub_NoLocal))
Constructor for a mqtt_bool object that has a parent.
Easy MqttObj class for automatically publishing and subscribing floating point values to/from an MQTT...
Definition mqtt.h:1771
virtual int RenderToBuffer(eObj_Serialize_t form, uint8_t *buf, int buflen) override
Render this object to an output buffer.
virtual int RenderToFd(eObj_Serialize_t form, int fd) override
Render this object to an output socket.
mqtt_float(mqtt_leaf &parent, double val, const char *topic, Client *mClient=NULL, uint16_t flags=(eObj_Flag_PubOnWrite|eObj_Flag_Subscribe|eObj_Flag_Sub_NoLocal))
Constructor for a mqtt_float object that has a parent.
virtual int SubscribeEvent(int mqttFd, PacketInfo::Msg *msg) override
Handle a message sent by the Broker triggered by this object's Subscription.
mqtt_float(const char *topic, Client *mClient=NULL, uint16_t flags=(eObj_Flag_PubOnWrite|eObj_Flag_Subscribe|eObj_Flag_Sub_NoLocal))
Constructor for a standalone mqtt_float object.
virtual int ParseFd(int mqttFd) override
the data from a file descriptor according to this object's current default serialization method and a...
virtual ValueTestResult TestOrSetValue(ParsedJsonDataSet &pjs, bool setVal) override
whether the current index of a JSON dataset is valid for this object, or assign the value at the curr...
mqtt_float(mqtt_leaf &parent, const char *topic, Client *mClient=NULL, uint16_t flags=(eObj_Flag_PubOnWrite|eObj_Flag_Subscribe|eObj_Flag_Sub_NoLocal))
Constructor for a mqtt_float object that has a parent.
void SetStringFormat(char formatChar, uint8_t precision)
the printf style format char to use when serializing this object in a string form.
Definition mqtt.h:1849
mqtt_float & operator=(double f)
Assignment operator for mqtt_float. Assigns the value to the object, then performs any post assignmen...
mqtt_float(double val, const char *topic, Client *mClient=NULL, uint16_t flags=(eObj_Flag_PubOnWrite|eObj_Flag_Subscribe|eObj_Flag_Sub_NoLocal))
Constructor for a standalone mqtt_float object.
Easy MqttObj class for automatically publishing and subscribing unsigned integer values to/from an MQ...
Definition mqtt.h:1483
int32_t operator--(int)
Postdecrement the object.
Definition mqtt.h:1575
virtual int ParseFd(int mqttFd) override
the data from a file descriptor according to this object's current default serialization method and a...
mqtt_int & operator=(int i)
Assignment operator for mqtt_int. Assigns the value to the object, then performs any post assignment ...
mqtt_int(mqtt_leaf &parent, const char *topic, Client *mClient=NULL, uint16_t flags=(eObj_Flag_PubOnWrite|eObj_Flag_Subscribe|eObj_Flag_Sub_NoLocal))
Constructor for a standalone mqtt_int object.
mqtt_int(int val, const char *topic, Client *mClient=NULL, uint16_t flags=(eObj_Flag_PubOnWrite|eObj_Flag_Subscribe|eObj_Flag_Sub_NoLocal))
Constructor for a standalone mqtt_int object.
virtual ValueTestResult TestOrSetValue(ParsedJsonDataSet &pjs, bool setVal) override
whether the current index of a JSON dataset is valid for this object, or assign the value at the curr...
virtual int RenderToFd(eObj_Serialize_t form, int fd) override
Render this object to an output socket.
mqtt_int & operator--()
Predecrement the object.
Definition mqtt.h:1569
mqtt_int & operator++()
Preincrement the object.
Definition mqtt.h:1557
virtual int RenderToBuffer(eObj_Serialize_t form, uint8_t *buf, int buflen) override
Render this object to an output buffer.
mqtt_int(const char *topic, Client *mClient=NULL, uint16_t flags=(eObj_Flag_PubOnWrite|eObj_Flag_Subscribe|eObj_Flag_Sub_NoLocal))
Constructor for a standalone mqtt_int object.
mqtt_int(mqtt_leaf &parent, int val, const char *topic, Client *mClient=NULL, uint16_t flags=(eObj_Flag_PubOnWrite|eObj_Flag_Subscribe|eObj_Flag_Sub_NoLocal))
Constructor for a standalone mqtt_int object.
int32_t operator++(int)
Postincrement the object.
Definition mqtt.h:1563
virtual int SubscribeEvent(int mqttFd, PacketInfo::Msg *msg) override
Handle a message sent by the Broker triggered by this object's Subscription.
Base class for all Mqtt Objects (MqttObj). Mqtt Objects provide a seamless bridge/synchronization to ...
Definition mqtt.h:906
bool MatchId(ParsedJsonDataSet &pjs)
Determine whether the JSON dataset's current index matches this object's name.
int QueuePublish()
Queue this object to be Published via the registered Client.
virtual void ClearFlags(uint16_t delFlags)
Clear behavioral flags from this object.
uint16_t GetFlags()
Get the behavioral flags set for this object.
Definition mqtt.h:1266
mqtt_leaf(const char *topic, Client *mClient, uint16_t flags=(eObj_Flag_PubOnWrite|eObj_Flag_Subscribe|eObj_Flag_Sub_NoLocal))
Constructor for mqtt_leaf objects.
static int MqttRxPublish(Client *mClient, int mqttFd, PacketInfo::Msg *msg, void *ctx)
Static message handler for Publish messages received by the registered Client.
uint16_t mFlags
Behavioral flags.
Definition mqtt.h:949
int HandleSubAck(int mqttFd, PacketInfo::Msg *msg)
Handle a Subscribe Acknowledge message from the broker for our Subscribe request.
virtual int RenderToFd(eObj_Serialize_t form, int fd)=0
Render this object to an output socket.
virtual mqtt_leaf * GetChildren()
Get the first child of this object.
virtual void SetSerializationForm(eObj_Serialize_t form)
Set the default serialization format for this object.
virtual void SetFlags(uint16_t newFlags)
Set additional behavioral flags for this object.
NBInterpolatedString topicName
Topic name or additional branch.
Definition mqtt.h:947
void SetPublishInterval(uint32_t intervalPeriodTicks)
Sets or clears an automatic publishing interval for this MQTT object.
void RemoveFromTree()
Remove this object from it's parent tree.
virtual int GetSubTopicFilter(NBString &s)
Get the Subscription Topic Filter this object Subscribes to.
int Assign()
Perform post assignemnt operations.
int QueueUnsubscribe()
Queue this object to be Unsubscribed via the registered Client.
mqtt_leaf(mqtt_leaf &parent, const char *topic, Client *mClient, uint16_t flags=(eObj_Flag_PubOnWrite|eObj_Flag_Subscribe|eObj_Flag_Sub_NoLocal))
Constructor for mqtt_leaf objects.
virtual void SetPubState(uint8_t newState)
Set the Publish state.
virtual int SubscribeEvent(int mqttFd, PacketInfo::Msg *msg)
Handle a message sent by the Broker triggered by this object's Subscription.
virtual ValueTestResult TestOrSetValue(ParsedJsonDataSet &pjs, bool setVal)=0
Test whether the current index of a JSON dataset is valid for this object, or assign the value at the...
void ForEachLeaf(LeafCallBack *p, void *pd)
Call a function on each element of the MqttObj tree with this object as the root.
virtual void SetSubState(uint8_t newState)
Set the Subscribe state.
int Publish(int waitForCompletion=-1)
Publishes the current MQTT object, optionally waiting for completion.
~mqtt_leaf()
~mqtt_leaf Destructor for base mqtt_leaf
int HandlePubAck(int mqttFd, PacketInfo::Msg *msg)
Handle an Publish Acknowledge message from the broker for our Publish request.
virtual mqtt_leaf * RemoveFirstChild()
Remove the first child from this object.
virtual int ParseFd(int mqttFd)=0
Parse the data from a file descriptor according to this object's current default serialization method...
eObj_Serialize_t publishForm
Default serialization form.
Definition mqtt.h:948
eObj_Serialize_t GetSerializationForm()
Get the default serialization format for this object.
Definition mqtt.h:1244
virtual int GetRenderLength(eObj_Serialize_t form=eObj_Serialize_CURRENT_FORM)
Get the number of bytes used to serialize this object in a particular format.
virtual mqtt_leaf * AddChild(mqtt_leaf *child)
Add an MqttObj as a child to this object.
int HandleUnsubAck(int mqttFd, PacketInfo::Msg *msg)
Handle an Unsubscribe Acknowledge message from the broker for our Unsubscribe request.
bool NameMatch(const char *cp)
Determine whether a given name matches this object.
int getPriority()
Get the message priority for this object.
Definition mqtt.h:1273
eObj_State_t
Mqtt Object Publication/Subscription States.
Definition mqtt.h:910
uint8_t PubState()
Get the Publish state.
Definition mqtt.h:1072
virtual int GetPubTopicName(NBString &s)
Get the Topic Name this object Publishes to.
void RootParse(ParsedJsonDataSet &pjs)
Assign to this object tree from a JSON dataset.
virtual int RenderToBuffer(eObj_Serialize_t form, uint8_t *buf, int buflen)=0
Render this object to an output buffer.
uint8_t SubState()
Get the Subscribe state of this object.
Definition mqtt.h:1079
int QueueSubscribe()
Queue this object to be Subscribed via the registered Client.
Base class for easy MQTT Objects (MqttObj). mqtt_obj are comprised of higher order parent objects tha...
Definition mqtt.h:1329
virtual mqtt_leaf * AddChild(mqtt_leaf *child) override
an MqttObj as a child to this object.
virtual void SetPubState(uint8_t newState) override
the Publish state
virtual void SetSubState(uint8_t newState) override
the Subscribe state
mqtt_leaf * FindChild(const char *topic)
the child object that is registered for the given Topic Name.
virtual int SubscribeEvent(int mqttFd, PacketInfo::Msg *msg) override
Handle a message sent by the Broker triggered by this object's Subscription.
mqtt_obj(mqtt_leaf &parent, const char *topic, Client *mClient, uint16_t flags=(eObj_Flag_PubOnWrite|eObj_Flag_Subscribe|eObj_Flag_Sub_NoLocal))
Constructor for an mqtt_obj with a known parent object.
virtual int RenderToFd(eObj_Serialize_t form, int fd) override
Render this object to an output socket.
mqtt_obj(const char *topic, Client *mClient, uint16_t flags=(eObj_Flag_PubOnWrite|eObj_Flag_Subscribe|eObj_Flag_Sub_NoLocal))
Constructor for a standalone mqtt_obj object.
virtual int GetSubTopicFilter(NBString &s) override
the Subscription Topic Filter this object Subscribes to.
virtual mqtt_leaf * GetChildren() override
the first child of this object.
~mqtt_obj()
~mqtt_obj Destructor for base mqtt_obj
virtual int GetRenderLength(eObj_Serialize_t form=eObj_Serialize_CURRENT_FORM) override
the number of bytes used to serialize this object in a particular format.
virtual mqtt_leaf * RemoveFirstChild() override
Remove the first child from this object.
virtual ValueTestResult TestOrSetValue(ParsedJsonDataSet &pjs, bool setVal) override
whether the current index of a JSON dataset is valid for this object, or assign the value at the curr...
virtual int RenderToBuffer(eObj_Serialize_t form, uint8_t *buf, int buflen) override
Render this object to an output buffer.
virtual int ParseFd(int mqttFd) override
the data from a file descriptor according to this object's current default serialization method and a...
Easy MqttObj class for automatically publishing and subscribing string values to/from an MQTT topic....
Definition mqtt.h:1919
mqtt_string & operator=(const NBString &s)
Assignment operator for mqtt_string. Assigns the value to the object, then performs any post assignme...
mqtt_string(const char *topic, Client *mClient=NULL, uint16_t flags=0)
Constructor for a standalone mqtt_string object.
char & operator[](size_t pos)
operator that returns a reference to the character at the given position.
Definition mqtt.h:2027
mqtt_string(mqtt_leaf &parent, const char *topic, Client *mClient=NULL, uint16_t flags=0)
Constructor for a mqtt_string object that has a parent.
mqtt_string(mqtt_leaf &parent, const NBString &val, const char *topic, Client *mClient=NULL, uint16_t flags=0)
Constructor for a mqtt_string object that has a parent.
mqtt_string(const char *val, const char *topic, Client *mClient=NULL, uint16_t flags=0)
Constructor for a standalone mqtt_string object.
virtual int ParseFd(int mqttFd) override
the data from a file descriptor according to this object's current default serialization method and a...
virtual ValueTestResult TestOrSetValue(ParsedJsonDataSet &pjs, bool setVal) override
Test whether the current index of a JSON dataset is valid for this object, or assign the value at the...
mqtt_string(mqtt_leaf &parent, const char *val, const char *topic, Client *mClient=NULL, uint16_t flags=0)
Constructor for a mqtt_string object that has a parent.
mqtt_string(const NBString &val, const char *topic, Client *mClient=NULL, uint16_t flags=0)
Constructor for a standalone mqtt_string object.
virtual int RenderToBuffer(eObj_Serialize_t form, uint8_t *buf, int buflen) override
Render this object to an output buffer.
mqtt_string & operator=(const char *s)
Assignment operator for mqtt_string. Assigns the value to the object, then performs any post assignme...
virtual int RenderToFd(eObj_Serialize_t form, int fd) override
Render this object to an output socket.
const char operator[](size_t pos) const
operator that returns the const char value of the character an the index. Operates on const objects.
Definition mqtt.h:2021
virtual int SubscribeEvent(int mqttFd, PacketInfo::Msg *msg) override
Handle a message sent by the Broker triggered by this object's Subscription.
Easy MqttObj class for automatically publishing and subscribing unsigned integer values to/from an MQ...
Definition mqtt.h:1628
uint32_t operator--(int)
Postdecrement the object.
Definition mqtt.h:1719
virtual int RenderToFd(eObj_Serialize_t form, int fd) override
Render this object to an output socket.
mqtt_uint(mqtt_leaf &parent, uint32_t val, const char *topic, Client *client, uint16_t flags=(eObj_Flag_PubOnWrite|eObj_Flag_Subscribe|eObj_Flag_Sub_NoLocal))
Constructor for a mqtt_uint object that has a parent.
uint32_t operator++(int)
Postincrement the object.
Definition mqtt.h:1707
mqtt_uint(const char *topic, Client *client, uint16_t flags=(eObj_Flag_PubOnWrite|eObj_Flag_Subscribe|eObj_Flag_Sub_NoLocal))
Constructor for a standalone mqtt_uint object.
mqtt_uint & operator++()
Preincrement the object.
Definition mqtt.h:1701
virtual int RenderToBuffer(eObj_Serialize_t form, uint8_t *buf, int buflen) override
Render this object to an output buffer.
mqtt_uint(mqtt_leaf &parent, const char *topic, Client *client, uint16_t flags=(eObj_Flag_PubOnWrite|eObj_Flag_Subscribe|eObj_Flag_Sub_NoLocal))
Constructor for a mqtt_uint object that has a parent.
mqtt_uint & operator=(uint32_t i)
Assignment operator for mqtt_uint. Assigns the value to the object, then performs any post assignment...
virtual int ParseFd(int mqttFd) override
the data from a file descriptor according to this object's current default serialization method and a...
virtual int SubscribeEvent(int mqttFd, PacketInfo::Msg *msg) override
Handle a message sent by the Broker triggered by this object's Subscription.
mqtt_uint & operator--()
Predecrement the object.
Definition mqtt.h:1713
mqtt_uint(uint32_t val, const char *topic, Client *client, uint16_t flags=(eObj_Flag_PubOnWrite|eObj_Flag_Subscribe|eObj_Flag_Sub_NoLocal))
Constructor for a standalone mqtt_uint object.
virtual ValueTestResult TestOrSetValue(ParsedJsonDataSet &pjs, bool setVal) override
whether the current index of a JSON dataset is valid for this object, or assign the value at the curr...
A wrapper for NBString::Interpolate() ideal for easy access to ephemeral values.
Definition nbstring.h:655
Lightweight alternative to C++ CString class.
Definition nbstring.h:118
A class to create, read, and modify a JSON object.
Definition json_lexer.h:535
Parsed Uniform Resource Identifier Class (URI)
Definition http_funcs.h:62
GPIO Pin Class.
Definition coldfire/cpu/MCF5441X/include/cpu_pins.h:15
TickTimeout objects are used to facilitate sequential function calls with timeout parameters that nee...
Definition nbrtos.h:168
Base class used to create configuration objects.
Definition config_obj.h:320
Configuration object, Filesystem Bulk Storage header file.
Configuration object header file.
NetBurner System Constants.
#define MQTT_TASK_PRIO
Definition constants.h:163
#define MQTT_OBJ_PRIORITY_COUNT
Definition mqtt.h:51
#define MQTT_DEFAULT_KEEP_ALIVE
Definition mqtt.h:61
void init()
System initialization. Ideally called at the beginning of all applications, since the easiest Recover...
NetBurner JSON Lexer. See the JSON Lexer page for complete documentation.
void UserMain(void *pd)
Main function.
Definition PlatformSpecific/SAME70/MODM7AE70/ADC_Simple/src/main.cpp:42
MQTT Namespace.
Definition mqtt.h:81
int(* MsgCallback_t)(MQTT::Client *mConn, int mqttFd, MQTT::PacketInfo::Msg *msg, void *ctx)
Function signature for a user-implemented callback function to receive messages from a subscription.
Definition mqtt.h:147
const char * GetPacketTypeString(Pkt::eType_t pkt)
Get the name of a specific eType_t protocol packet type.
const char * GetReturnCodeString(MQTT::eResult_t result)
Get the name of a specific API eResult_t return code.
@ eObj_Flag_DynTopicName
<++>
Definition mqtt.h:190
@ eObj_Flag_PubQoS_ExactlyOnce
Publish using QoS == At Most Once.
Definition mqtt.h:178
@ eObj_Flag_Sub_Retained_Never
Never receive Retained messages, unless connected and subscribed when they are sent.
Definition mqtt.h:187
@ eObj_Flag_PubRetain
Publish with Retain set.
Definition mqtt.h:179
@ eObj_Flag_Sub_QoS_ExactlyOnce
Receive Publish messages at QoS == At Most Once.
Definition mqtt.h:184
@ eObj_Flag_PubQoS_AtLeastOnce
Publish using QoS == At Least Once.
Definition mqtt.h:177
@ eObj_Flag_Sub_Retained_IfNew
When subscribing/connecting, only receive the Retained Publish, if it is new since last subscribed/co...
Definition mqtt.h:186
@ eObj_Flag_Sub_QoS_AtLeastOnce
Receive Publish messages at QoS == At Least Once.
Definition mqtt.h:183
@ eObj_Flag_Sub_HandlerOnly
<++>
Definition mqtt.h:181
@ eObj_Flag_PubOnWrite
Publish object whenever it is written to.
Definition mqtt.h:176
@ eObj_Flag_WaitForPub
Assigning to the object blocks until new value has been published.
Definition mqtt.h:189
@ eObj_Flag_Sub_NoLocal
Do not Receive Local Publish Messages.
Definition mqtt.h:185
@ eObj_Flag_Subscribe
Automatically subscribe to the objects Topic.
Definition mqtt.h:180
@ eObj_Flag_Sub_IncludeLocal
Receive Publish messages sent by the object's client (aka, receive an Echo)
Definition mqtt.h:182
eResult_t
MQTT library return codes.
Definition mqtt.h:85
@ eResult_Mqtt_PayFmt_Invalid
Payload Format error (malformed message)
Definition mqtt.h:113
@ eResult_Mqtt_NotSupported_SubIds
Broker does not support Subscription IDs.
Definition mqtt.h:121
@ eResult_Mqtt_NotSupported_QoS
Requested QoS level not supported for prior Publish Message.
Definition mqtt.h:115
@ eResult_Mqtt_SessTakeover
Session has been taken over by another connection.
Definition mqtt.h:102
@ eResult_Mqtt_NotSupported_SharedSubs
Broker does not support Shared Subscriptions.
Definition mqtt.h:118
@ eResult_Mqtt_TopicAlias_Invalid
Requested Topic Alias is invalid/unknown.
Definition mqtt.h:108
@ eResult_Mqtt_NotSupported_Retain
Retain not supported for prior Publish Message.
Definition mqtt.h:114
@ eResult_Error_Malformed
Malformed argument.
Definition mqtt.h:130
@ eResult_Mqtt_MalformedPkt
Malformed Mqtt msg was sent/received.
Definition mqtt.h:89
@ eResult_Mqtt_NotSupported_WildSubs
Broker does not support Wildcard Subscriptions.
Definition mqtt.h:122
@ eResult_Mqtt_TooLarge
Message Size too large.
Definition mqtt.h:109
@ eResult_Error_NetErr
General network layer error.
Definition mqtt.h:124
@ eResult_Mqtt_Protocol
Unsupported or unknown protocol.
Definition mqtt.h:90
@ eResult_Success
No error, completed successfully.
Definition mqtt.h:86
@ eResult_Mqtt_UnsupportedProtoVer
Unsupported MQTT protocol version.
Definition mqtt.h:92
@ eResult_Mqtt_UserPassword
Invalid Username/password.
Definition mqtt.h:94
@ eResult_Mqtt_NameInvalid
Submitted Topic Name is invalid.
Definition mqtt.h:104
@ eResult_Mqtt_Banned
Client is banned by the broker.
Definition mqtt.h:98
@ eResult_Mqtt_ServerUnavail
Broker unavailable.
Definition mqtt.h:96
@ eResult_Error_Timeout
Operation timed out.
Definition mqtt.h:131
@ eResult_Mqtt_NotAuthorized
Client not authorized.
Definition mqtt.h:95
@ eResult_Mqtt_Admin
General Administrative error.
Definition mqtt.h:112
@ eResult_Socket_TryAgain
Client Network Socket error, try again.
Definition mqtt.h:125
@ eResult_Mqtt_KATimeout
Keep Alive Timeout exceeded.
Definition mqtt.h:101
@ eResult_Mqtt_Quota
Exceeded client message quota.
Definition mqtt.h:111
@ eResult_Mqtt_ClientIdInvalid
Broker refusing current Client ID.
Definition mqtt.h:93
@ eResult_Error_InvalidURI
Provided Broker address URI is invalid.
Definition mqtt.h:128
@ eResult_Mqtt_PktId_NotFound
Broker has no outstanding packet with the requested ID.
Definition mqtt.h:106
@ eResult_Error_NoSuchConn
No such connection.
Definition mqtt.h:133
@ eResult_Mqtt_ServerMoved
Broker Permanently Moved to new address.
Definition mqtt.h:117
@ eResult_Error_BadArg
General Bad Argument.
Definition mqtt.h:134
@ eResult_Mqtt_MsgRate
Exceeded client rate limit.
Definition mqtt.h:110
@ eResult_Mqtt_Implementation
Feature/option not implemented.
Definition mqtt.h:91
@ eResult_Error_BadProp
Argument contains malformed Message Property.
Definition mqtt.h:132
@ eResult_Cont_Auth
<++>
Definition mqtt.h:127
@ eResult_Mqtt_PktId_InUse
Broker has an outstanding Reliable QOS Packet with the same ID (sending Subscribe when a Publish with...
Definition mqtt.h:105
@ eResult_Mqtt_ConnRate
Exceeded Connection Rate Limit.
Definition mqtt.h:119
@ eResult_Mqtt_FilterInvalid
A submitted request filter is invalid.
Definition mqtt.h:103
@ eResult_Mqtt_RcvMax_Exceeded
<++>
Definition mqtt.h:107
@ eResult_Mqtt_UseOther
Client should connect to specified Other Broker (equivalent to HTTP 3xx redirect)
Definition mqtt.h:116
@ eResult_Mqtt_BadAuthMethod
Broker does not support the requested authentication method.
Definition mqtt.h:100
@ eResult_Mqtt_ServerShutdown
Broker is shutting down.
Definition mqtt.h:99
@ eResult_Mqtt_Unspecified
Unknown/Unspecified error.
Definition mqtt.h:88
@ eResult_Mqtt_Transport_Error
Transport layer error.
Definition mqtt.h:123
@ eResult_Socket_NeedDNS
Broker address failed to resolve DNS.
Definition mqtt.h:126
@ eResult_Error_NoneAvail
Required resource exhausted, none available.
Definition mqtt.h:129
@ eResult_Mqtt_ServerBusy
Broker is unable to process message at this time.
Definition mqtt.h:97
@ eResult_Mqtt_MaxConnTime
Exceeded Maximum Connection Time limit.
Definition mqtt.h:120
const char * GetConnectionStatusString(int status)
Get the name of a specific GetConnectionStatus return code.
eObj_Serialize_t
MqttObj Serialization Formats.
Definition mqtt.h:196
@ eObj_Serialize_MqttString
Serialize as a MQTT Protocol level string.
Definition mqtt.h:201
@ eObj_Serialize_LittleEndian
Serialize as binary, Little Endian ordering.
Definition mqtt.h:203
@ eObj_Serialize_BigEndian
Serialize as binary, Big Endian ordering.
Definition mqtt.h:202
@ eObj_Serialize_Disabled
Do not serialize, used to disable serialization of branches in complex structures.
Definition mqtt.h:197
@ eObj_Serialize_NativeEndian
Serialize as binary, host native ordering.
Definition mqtt.h:204
@ eObj_Serialize_String
Serialize as a null terminated string.
Definition mqtt.h:198
@ eObj_Serialize_CURRENT_FORM
Serialize as the object's current defined form (only valid if the object has a currently assigned for...
Definition mqtt.h:205
@ eObj_Serialize_JSON_ValOnly
Serialize as a JSON value.
Definition mqtt.h:200
@ eObj_Serialize_JSON
Serialize as a JSON name:value pair.
Definition mqtt.h:199
PacketInfo::Msg message data structure.
Definition mqtt_msg_reqs.h:70
Structure used to specify details for a Publish call.
Definition mqtt_msg_reqs.h:207
Structure used to specify details for a Subscribe call.
Definition mqtt_msg_reqs.h:286
TopicHandler context definition.
Definition mqtt.h:155
MsgCallback_t handleMsg
Handler method to call.
Definition mqtt.h:157
NBString topicFilter
Filter used to describe which topics this handler covers.
Definition mqtt.h:156
void * ctx
User provided extra data passed to the handler method.
Definition mqtt.h:158
An OS_CRIT object is used to establish critical sections of code that can only be run by one task at ...
Definition nbrtos.h:1110
Semaphores are used to control access to shared resources or or to communicate between tasks in a mul...
Definition nbrtos.h:411