NetBurner 3.5.6
PDF Version |
NetBurner MQTT Library. More...
#include <predef.h>
#include <constants.h>
#include <config_obj.h>
#include <config_fs_bulkstore.h>
#include <nettimer.h>
#include <mqtt/msg_types.h>
#include <mqtt/mqtt_msg_reqs.h>
#include <webclient/http_funcs.h>
#include <json_lexer.h>
#include <pins.h>
#include <crypto/NetBurner/NbSslCtx.h>
#include <mqtt/mqtt_internal.h>
#include <mqtt/config_mqtt_obj.h>
Go to the source code of this file.
Classes | |
struct | MQTT::TopicHandler |
TopicHandler context definition. More... | |
class | MQTT::Client |
Advanced low-level MQTT Client for interacting with Mqtt Brokers. The client handles all network communications with the Broker and handles local message queueing and dispatching to topic handlers. More... | |
class | MQTT::ConfiguredClient |
Easy MQTT Client wrapper for interacting with MQTT brokers. The client handles all network communications with the Broker and handles local message queueing and dispatching to topic handlers. Adds ConfigObj for automatically configuring all Client settings via the Config System. More... | |
class | MQTT::mqtt_leaf |
Base class for all Mqtt Objects (MqttObj). Mqtt Objects provide a seamless bridge/synchronization to communicate information through an MQTT Broker via a Client object. More... | |
class | MQTT::mqtt_obj |
Base class for easy MQTT Objects (MqttObj). mqtt_obj are comprised of higher order parent objects that contain registered child objects. More... | |
class | MQTT::mqtt_int |
Easy MqttObj class for automatically publishing and subscribing unsigned integer values to/from an MQTT topic. Use like a normal int32_t. More... | |
class | MQTT::mqtt_uint |
Easy MqttObj class for automatically publishing and subscribing unsigned integer values to/from an MQTT topic. Use like a normal uint32_t. More... | |
class | MQTT::mqtt_float |
Easy MqttObj class for automatically publishing and subscribing floating point values to/from an MQTT topic. Use like a normal double. More... | |
class | MQTT::mqtt_string |
Easy MqttObj class for automatically publishing and subscribing string values to/from an MQTT topic. Use like a normal NBString. More... | |
class | MQTT::mqtt_bool |
Easy MqttObj class for automatically publishing and subscribing boolean values to/from an MQTT topic. Use like a normal bool. More... | |
class | MQTT::mqtt_IO |
Easy MqttObj class for automatically publishing and subscribing hardware GPIO pins to/from an MQTT topic. Use like a normal PinIO. More... | |
class | MQTT::mqtt_IO_Input |
MqttObj connecting hardware GPIO pins to an Mqtt Broker. This class defaults the pin to an Input state. More... | |
class | MQTT::mqtt_IO_Output |
MqttObj connecting hardware GPIO pins to an Mqtt Broker. This class defaults the pin to an Output state. More... | |
class | MQTT::ConfigExposer |
Easy MqttObj class for automatically publishing and subscribing NetBurner Config system objects to/from an MQTT topic. Use like a normal ConfigObj. More... | |
class | MQTT::SubHandler |
Easy class for registering a callback function that receives messages on an MQTT topic and handles them appropriately. Behaves similarly to HttpResponseHandler. More... | |
Namespaces | |
namespace | MQTT |
MQTT Namespace. | |
Macros | |
#define | MQTT_WAIT (TICKS_PER_SECOND*10) |
| |
#define | MQTT_TLS_NEGOTIATE_TIMEOUT (TICKS_PER_SECOND*50) |
| |
#define | MQTT_OBJ_PRIORITY_COUNT (16) |
| |
#define | MQTT_OBJ_PRIORITY_MAX 0 |
| |
#define | MQTT_OBJ_PRIORITY_MIN 15 |
| |
#define | MQTT_MAX_PKT_SIZE (0x2FFFFFFF) |
| |
#define | MQTT_MAX_MAX_SUPPORTED_IN_FLIGHT (256) |
| |
#define | MQTT_MAX_SUPPORTED_IN_FLIGHT (16) |
| |
#define | MQTT_MAX_HANDLERS_PER_CONNECTION (256) |
| |
#define | MQTT_MAX_SUPPORTED_RX_TOPIC_ALIASES (128) |
| |
#define | MQTT_DEFAULT_SESSION_EXPIRY_INTERVAL (3600) |
| |
#define | MQTT_DEFAULT_KEEP_ALIVE (30) |
| |
#define | MQTT_MAX_SUB_IDs (128) |
| |
Typedefs | |
typedef int(* | MQTT::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. | |
Functions | |
void | UserMain (void *pd) |
Main function. | |
const char * | MQTT::GetPacketTypeString (Pkt::eType_t pkt) |
Get the name of a specific eType_t protocol packet type. | |
const char * | MQTT::GetReturnCodeString (MQTT::eResult_t result) |
Get the name of a specific API eResult_t return code. | |
const char * | MQTT::GetConnectionStatusString (int status) |
Get the name of a specific GetConnectionStatus return code. | |
NetBurner MQTT Library.
void UserMain | ( | void * | pd | ) |
Main function.
UserMain
Main entry point for the example
UserMain
Main entry point of the example
UserMain
Main entry point to the example
UserMain
The main task
UserMain, the entry point of the example
UserMain
Main entry point of program
UserMain
Main entry point for example
Main function.
UserMain Task
UserMain Task This is the first task to be executed and will create the UDP Reader Task.
UserMain This is the first task to be executed and will create the UDP Reader Task.
UserMain
Main entry point for the program
Set up a file descriptor (FD) set so we can select() on the serial ports. Once configured, the select() function will block until activity is detected on a FD (a serial port in this example), or a timeout occurs (set to 1 second here). If a timeout does occur, we simply go back to the select() function and wait for more activity. The "write" and "error" FD sets of the select() function are not used and set to nullptr; only read operations caused by the items in read_fds will cause select() to exit. A timeout value of 0 would disable the timeout, and select() would wait forever.
Detailed description of how select() works: The select() function operates on a bit mapped field of 64 bits. In this example, the bit field is read_fds. When select() is called, read_fds represents a MASK of which file descriptors to check. AFTER select() exits, read_fds contains the STATUS of which file descriptors have pending events. This means that read_fds must be reinitialized to contain MASK information each time before select() is called. FD_ZERO, FD_SET, and FD_ISSET are macros that execute very fast.