Macros | Functions
MQTTProtocolClient.h File Reference
#include "LinkedList.h"
#include "MQTTPacket.h"
#include "Log.h"
#include "MQTTProtocol.h"
#include "Messages.h"
#include "MQTTProperties.h"
Include dependency graph for MQTTProtocolClient.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define MAX_CLIENTID_LEN   65535
 
#define MAX_MSG_ID   65535
 

Functions

int messageIDCompare (void *a, void *b)
 
int MQTTProtocol_assignMsgId (Clients *client)
 
void MQTTProtocol_closeSession (Clients *c, int sendwill)
 
MessagesMQTTProtocol_createMessage (Publish *publish, Messages **mm, int qos, int retained, int allocatePayload)
 
void MQTTProtocol_emptyMessageList (List *msgList)
 
void MQTTProtocol_freeClient (Clients *client)
 
void MQTTProtocol_freeMessageList (List *msgList)
 
int MQTTProtocol_handlePubacks (void *pack, int sock)
 
int MQTTProtocol_handlePubcomps (void *pack, int sock)
 
int MQTTProtocol_handlePublishes (void *pack, int sock)
 
int MQTTProtocol_handlePubrecs (void *pack, int sock)
 
int MQTTProtocol_handlePubrels (void *pack, int sock)
 
void MQTTProtocol_keepalive (START_TIME_TYPE)
 
void MQTTProtocol_removePublication (Publications *p)
 
void MQTTProtocol_retry (START_TIME_TYPE, int, int)
 
int MQTTProtocol_startPublish (Clients *pubclient, Publish *publish, int qos, int retained, Messages **m)
 
PublicationsMQTTProtocol_storePublication (Publish *publish, int *len)
 
char * MQTTStrdup (const char *src)
 
char * MQTTStrncpy (char *dest, const char *src, size_t num)
 
void Protocol_processPublication (Publish *publish, Clients *client, int allocatePayload)
 

Macro Definition Documentation

#define MAX_CLIENTID_LEN   65535

Definition at line 32 of file MQTTProtocolClient.h.

#define MAX_MSG_ID   65535

Definition at line 31 of file MQTTProtocolClient.h.

Function Documentation

int messageIDCompare ( void *  a,
void *  b 
)

List callback function for comparing Message structures by message id

Parameters
afirst integer value
bsecond integer value
Returns
boolean indicating whether a and b are equal

Definition at line 65 of file MQTTProtocolClient.c.

int MQTTProtocol_assignMsgId ( Clients client)

Assign a new message id for a client. Make sure it isn't already being used and does not exceed the maximum.

Parameters
clienta client structure
Returns
the next message id to use, or 0 if none available

Definition at line 78 of file MQTTProtocolClient.c.

void MQTTProtocol_closeSession ( Clients c,
int  sendwill 
)

mqttclient_mutex must be locked when you call this function, if multi threaded

Definition at line 3917 of file MQTTAsync.c.

Messages* MQTTProtocol_createMessage ( Publish publish,
Messages **  mm,
int  qos,
int  retained,
int  allocatePayload 
)

Copy and store message data for retries

Parameters
publishthe publication data
mm- pointer to the message data to store
qosthe MQTT QoS to use
retainedboolean - whether to set the MQTT retained flag
allocatePayloadboolean - whether or not to malloc payload
Returns
pointer to the message data stored

Definition at line 196 of file MQTTProtocolClient.c.

void MQTTProtocol_emptyMessageList ( List msgList)

Empty a message list, leaving it able to accept new messages

Parameters
msgListthe message list to empty

Definition at line 862 of file MQTTProtocolClient.c.

void MQTTProtocol_freeClient ( Clients client)

Free a client structure

Parameters
clientthe client data to free

Definition at line 811 of file MQTTProtocolClient.c.

void MQTTProtocol_freeMessageList ( List msgList)

Empty and free up all storage used by a message list

Parameters
msgListthe message list to empty and free

Definition at line 883 of file MQTTProtocolClient.c.

int MQTTProtocol_handlePubacks ( void *  pack,
int  sock 
)

Process an incoming puback packet for a socket

Parameters
packpointer to the publish packet
sockthe socket on which the packet was received
Returns
completion code

Definition at line 407 of file MQTTProtocolClient.c.

int MQTTProtocol_handlePubcomps ( void *  pack,
int  sock 
)

Process an incoming pubcomp packet for a socket

Parameters
packpointer to the publish packet
sockthe socket on which the packet was received
Returns
completion code

Definition at line 601 of file MQTTProtocolClient.c.

int MQTTProtocol_handlePublishes ( void *  pack,
int  sock 
)

Process an incoming publish packet for a socket The payload field of the packet has not been transferred to another buffer at this point. If it's needed beyond the scope of this function, it has to be copied.

Parameters
packpointer to the publish packet
sockthe socket on which the packet was received
Returns
completion code

Definition at line 305 of file MQTTProtocolClient.c.

int MQTTProtocol_handlePubrecs ( void *  pack,
int  sock 
)

Process an incoming pubrec packet for a socket

Parameters
packpointer to the publish packet
sockthe socket on which the packet was received
Returns
completion code

Definition at line 453 of file MQTTProtocolClient.c.

int MQTTProtocol_handlePubrels ( void *  pack,
int  sock 
)

Process an incoming pubrel packet for a socket

Parameters
packpointer to the publish packet
sockthe socket on which the packet was received
Returns
completion code

Definition at line 522 of file MQTTProtocolClient.c.

void MQTTProtocol_keepalive ( START_TIME_TYPE  now)

MQTT protocol keepAlive processing. Sends PINGREQ packets as required.

Parameters
nowcurrent time

Definition at line 656 of file MQTTProtocolClient.c.

void MQTTProtocol_removePublication ( Publications p)

Remove stored message data. Opposite of storePublication

Parameters
pstored publication to remove

Definition at line 285 of file MQTTProtocolClient.c.

void MQTTProtocol_retry ( START_TIME_TYPE  now,
int  doRetry,
int  regardless 
)

MQTT retry protocol and socket pending writes processing.

Parameters
nowcurrent time
doRetryboolean - retries as well as pending writes?
regardlessboolean - retry packets regardless of retry interval (used on reconnect)

Definition at line 780 of file MQTTProtocolClient.c.

int MQTTProtocol_startPublish ( Clients pubclient,
Publish publish,
int  qos,
int  retained,
Messages **  mm 
)

Start a new publish exchange. Store any state necessary and try to send the packet

Parameters
pubclientthe client to send the publication to
publishthe publication data
qosthe MQTT QoS to use
retainedboolean - whether to set the MQTT retained flag
mm- pointer to the message to send
Returns
the completion code

Definition at line 162 of file MQTTProtocolClient.c.

Publications* MQTTProtocol_storePublication ( Publish publish,
int *  len 
)

Store message data for possible retry

Parameters
publishthe publication data
lenreturned length of the data stored
Returns
the publication stored

Definition at line 252 of file MQTTProtocolClient.c.

char* MQTTStrdup ( const char *  src)

Duplicate a string, safely, allocating space on the heap

Parameters
srcthe source string which characters copy from
Returns
the duplicated, allocated string

Definition at line 925 of file MQTTProtocolClient.c.

char* MQTTStrncpy ( char *  dest,
const char *  src,
size_t  dest_size 
)

Copy no more than dest_size -1 characters from the string pointed to by src to the array pointed to by dest. The destination string will always be null-terminated.

Parameters
destthe array which characters copy to
srcthe source string which characters copy from
dest_sizethe size of the memory pointed to by dest: copy no more than this -1 (allow for null). Must be >= 1
Returns
the destination string pointer

Definition at line 900 of file MQTTProtocolClient.c.

void Protocol_processPublication ( Publish publish,
Clients client,
int  allocatePayload 
)

Definition at line 3396 of file MQTTAsync.c.



plotjuggler
Author(s): Davide Faconti
autogenerated on Sun Dec 6 2020 04:02:49