MQTTProtocolOut.c File Reference
Functions dealing with the MQTT protocol exchanges.
More...
#include <stdlib.h>
#include <string.h>
#include "MQTTProtocolOut.h"
#include "StackTrace.h"
#include "Heap.h"
Functions |
char * | MQTTProtocol_addressPort (const char *uri, int *port) |
| Separates an address:port into two separate values.
|
int | MQTTProtocol_connect (const char *ip_address, Clients *aClient, int MQTTVersion) |
| MQTT outgoing connect processing for a client.
|
int | MQTTProtocol_handlePingresps (void *pack, int sock) |
| Process an incoming pingresp packet for a socket.
|
int | MQTTProtocol_subscribe (Clients *client, List *topics, List *qoss, int msgID) |
| MQTT outgoing subscribe processing for a client.
|
int | MQTTProtocol_handleSubacks (void *pack, int sock) |
| Process an incoming suback packet for a socket.
|
int | MQTTProtocol_unsubscribe (Clients *client, List *topics, int msgID) |
| MQTT outgoing unsubscribe processing for a client.
|
int | MQTTProtocol_handleUnsubacks (void *pack, int sock) |
| Process an incoming unsuback packet for a socket.
|
Variables |
ClientStates * | bstate |
Detailed Description
Functions dealing with the MQTT protocol exchanges.
Some other related functions are in the MQTTProtocolClient module
Function Documentation
char* MQTTProtocol_addressPort |
( |
const char * |
uri, |
|
|
int * |
port | |
|
) |
| | |
Separates an address:port into two separate values.
- Parameters:
-
| uri | the input string - hostname:port |
| port | the returned port integer |
- Returns:
- the address string
int MQTTProtocol_connect |
( |
const char * |
ip_address, |
|
|
Clients * |
aClient, |
|
|
int |
MQTTVersion | |
|
) |
| | |
MQTT outgoing connect processing for a client.
- Parameters:
-
| 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) |
- Returns:
- return code
int MQTTProtocol_handlePingresps |
( |
void * |
pack, |
|
|
int |
sock | |
|
) |
| | |
Process an incoming pingresp packet for a socket.
- Parameters:
-
| pack | pointer to the publish packet |
| sock | the socket on which the packet was received |
- Returns:
- completion code
int MQTTProtocol_handleSubacks |
( |
void * |
pack, |
|
|
int |
sock | |
|
) |
| | |
Process an incoming suback packet for a socket.
- Parameters:
-
| pack | pointer to the publish packet |
| sock | the socket on which the packet was received |
- Returns:
- completion code
int MQTTProtocol_handleUnsubacks |
( |
void * |
pack, |
|
|
int |
sock | |
|
) |
| | |
Process an incoming unsuback packet for a socket.
- Parameters:
-
| pack | pointer to the publish packet |
| sock | the socket on which the packet was received |
- Returns:
- completion code
int MQTTProtocol_subscribe |
( |
Clients * |
client, |
|
|
List * |
topics, |
|
|
List * |
qoss, |
|
|
int |
msgID | |
|
) |
| | |
MQTT outgoing subscribe processing for a client.
- Parameters:
-
| client | the client structure |
| topics | list of topics |
| qoss | corresponding list of QoSs |
- Returns:
- completion code
int MQTTProtocol_unsubscribe |
( |
Clients * |
client, |
|
|
List * |
topics, |
|
|
int |
msgID | |
|
) |
| | |
MQTT outgoing unsubscribe processing for a client.
- Parameters:
-
| client | the client structure |
| topics | list of topics |
- Returns:
- completion code