Functions dealing with the MQTT protocol exchanges. More...
#include <stdlib.h>#include <string.h>#include <ctype.h>#include "MQTTProtocolOut.h"#include "StackTrace.h"#include "Heap.h"#include "WebSocket.h"#include "Base64.h"
Go to the source code of this file.
Functions | |
| size_t | MQTTProtocol_addressPort (const char *uri, int *port, const char **topic, int default_port) |
| int | MQTTProtocol_connect (const char *ip_address, Clients *aClient, int websocket, int MQTTVersion, MQTTProperties *connectProperties, MQTTProperties *willProperties) |
| int | MQTTProtocol_handlePingresps (void *pack, int sock) |
| int | MQTTProtocol_handleSubacks (void *pack, int sock) |
| int | MQTTProtocol_handleUnsubacks (void *pack, int sock) |
| void | MQTTProtocol_specialChars (char *p0, char *p1, b64_size_t *basic_auth_in_len) |
| int | MQTTProtocol_subscribe (Clients *client, List *topics, List *qoss, int msgID, MQTTSubscribe_options *opts, MQTTProperties *props) |
| int | MQTTProtocol_unsubscribe (Clients *client, List *topics, int msgID, MQTTProperties *props) |
Variables | |
| ClientStates * | bstate |
Functions dealing with the MQTT protocol exchanges.
Some other related functions are in the MQTTProtocolClient module
Definition in file MQTTProtocolOut.c.
| size_t MQTTProtocol_addressPort | ( | const char * | uri, |
| int * | port, | ||
| const char ** | topic, | ||
| int | default_port | ||
| ) |
Separates an address:port into two separate values
| [in] | uri | the input string - hostname:port |
| [out] | port | the returned port integer |
| [out] | topic | optional topic portion of the address starting with '/' |
Definition at line 54 of file MQTTProtocolOut.c.
| int MQTTProtocol_connect | ( | const char * | ip_address, |
| Clients * | aClient, | ||
| int | websocket, | ||
| int | MQTTVersion, | ||
| MQTTProperties * | connectProperties, | ||
| MQTTProperties * | willProperties | ||
| ) |
MQTT outgoing connect processing for a client
| ip_address | the TCP address:port to connect to |
| aClient | a structure with all MQTT data needed |
| int | ssl |
| int | MQTTVersion the MQTT version to connect with (3 or 4) |
| long | timeout how long to wait for a new socket to be created |
Definition at line 149 of file MQTTProtocolOut.c.
| int MQTTProtocol_handlePingresps | ( | void * | pack, |
| int | sock | ||
| ) |
Process an incoming pingresp packet for a socket
| pack | pointer to the publish packet |
| sock | the socket on which the packet was received |
Definition at line 335 of file MQTTProtocolOut.c.
| int MQTTProtocol_handleSubacks | ( | void * | pack, |
| int | sock | ||
| ) |
Process an incoming suback packet for a socket
| pack | pointer to the publish packet |
| sock | the socket on which the packet was received |
Definition at line 376 of file MQTTProtocolOut.c.
| int MQTTProtocol_handleUnsubacks | ( | void * | pack, |
| int | sock | ||
| ) |
Process an incoming unsuback packet for a socket
| pack | pointer to the publish packet |
| sock | the socket on which the packet was received |
Definition at line 414 of file MQTTProtocolOut.c.
| void MQTTProtocol_specialChars | ( | char * | p0, |
| char * | p1, | ||
| b64_size_t * | basic_auth_in_len | ||
| ) |
Allow user or password characters to be expressed in the form of XX, XX being the hexadecimal value of the caracter. This will avoid problems when a user code or a password contains a '@' or another special character ('' included)
| p0 | |
| p1 | |
| basic_auth_in_len |
Definition at line 105 of file MQTTProtocolOut.c.
| int MQTTProtocol_subscribe | ( | Clients * | client, |
| List * | topics, | ||
| List * | qoss, | ||
| int | msgID, | ||
| MQTTSubscribe_options * | opts, | ||
| MQTTProperties * | props | ||
| ) |
MQTT outgoing subscribe processing for a client
| client | the client structure |
| topics | list of topics |
| qoss | corresponding list of QoSs |
| opts | MQTT 5.0 subscribe options |
| props | MQTT 5.0 subscribe properties |
Definition at line 358 of file MQTTProtocolOut.c.
| int MQTTProtocol_unsubscribe | ( | Clients * | client, |
| List * | topics, | ||
| int | msgID, | ||
| MQTTProperties * | props | ||
| ) |
MQTT outgoing unsubscribe processing for a client
| client | the client structure |
| topics | list of topics |
Definition at line 397 of file MQTTProtocolOut.c.
| ClientStates* bstate |
Definition at line 117 of file MQTTAsync.c.