MQTT C Client Libraries Internals
Functions
Clients.c File Reference

functions which apply to client structures More...

#include "Clients.h"
#include <string.h>
#include <stdio.h>
Include dependency graph for Clients.c:

Functions

int clientIDCompare (void *a, void *b)
 List callback function for comparing clients by clientid. More...
 
int clientSocketCompare (void *a, void *b)
 List callback function for comparing clients by socket. More...
 

Detailed Description

functions which apply to client structures

Function Documentation

◆ clientIDCompare()

int clientIDCompare ( void *  a,
void *  b 
)

List callback function for comparing clients by clientid.

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

◆ clientSocketCompare()

int clientSocketCompare ( void *  a,
void *  b 
)

List callback function for comparing clients by socket.

Parameters
afirst integer value
bsecond integer value
Returns
boolean indicating whether a and b are equal
pstclear
int pstclear(void *handle)
Delete all the persisted message in the client persistence directory.
Definition: MQTTPersistenceDefault.c:543
MQTTClient_connectOptions::httpHeaders
const MQTTClient_nameValue * httpHeaders
HTTP headers for websockets.
Definition: MQTTClient.h:970
MQTTClient_willOptions::data
const void * data
binary payload data
Definition: MQTTClient.h:648
MQTTProperty::integer2
unsigned short integer2
holds the value of a 2 byte integer property type
Definition: MQTTProperties.h:100
List::current
ListElement * current
current element in the list, for iteration
Definition: LinkedList.h:71
MQTTClient_persistence::pget
Persistence_get pget
A function pointer to an implementation of Persistence_get().
Definition: MQTTClientPersistence.h:235
Socket_clearPendingWrite
void Socket_clearPendingWrite(SOCKET socket)
Clear a socket from the pending write list - if one was added with Socket_addPendingWrite.
Definition: Socket.c:848
MQTTClient_disconnect_internal
static int MQTTClient_disconnect_internal(MQTTClient handle, int timeout)
mqttclient_mutex must be locked when you call this function, if multi threaded
Definition: MQTTClient.c:1956
socket_queue::datalen
size_t datalen
current length of data in buf
Definition: SocketBuffer.h:40
Connect::all
unsigned char all
all connect flags
Definition: MQTTPacket.h:94
MQTTProtocol_freeClient
void MQTTProtocol_freeClient(Clients *client)
Free a client structure.
Definition: MQTTProtocolClient.c:908
MQTTClient_connectOptions::sessionPresent
int sessionPresent
if the MQTT version is 3.1.1, the value of sessionPresent returned in the connack
Definition: MQTTClient.h:949
MQTTAsync_nameValue
Utility structure where name/value pairs are needed.
Definition: MQTTAsync.h:1182
MQTTLenString::data
char * data
pointer to the string data
Definition: MQTTProperties.h:87
Socket_getReadySocket
SOCKET Socket_getReadySocket(int more_work, int timeout, mutex_type mutex, int *rc)
Returns the next socket ready for communications as indicated by select.
Definition: Socket.c:485
MQTTProperties::length
int length
mbi: byte length of all properties
Definition: MQTTProperties.h:116
NodeStruct
Structure to hold all data for one list element.
Definition: Tree.h:63
ListDetachHead
void * ListDetachHead(List *aList)
Removes and frees an the first item in a list.
Definition: LinkedList.c:268
Persistence_clear
int(* Persistence_clear)(void *handle)
Clears the persistence store, so that it no longer contains any persisted data.
Definition: MQTTClientPersistence.h:197
MQTTProtocol_subscribe
int MQTTProtocol_subscribe(Clients *client, List *topics, List *qoss, int msgID, MQTTSubscribe_options *opts, MQTTProperties *props)
MQTT outgoing subscribe processing for a client.
Definition: MQTTProtocolOut.c:388
MQTTAsync_willOptions
MQTTAsync_willOptions defines the MQTT "Last Will and Testament" (LWT) settings for the client.
Definition: MQTTAsync.h:1020
trace_destination_backup_name
static char * trace_destination_backup_name
the name of the backup trace file
Definition: Log.c:105
ListElementStruct::prev
struct ListElementStruct * prev
pointer to previous list element
Definition: LinkedList.h:74
MQTTClient_global_init
void MQTTClient_global_init(MQTTClient_init_options *inits)
Global init of mqtt library.
Definition: MQTTClient.c:93
MQTTClient_SSLOptions
MQTTClient_sslProperties defines the settings to establish an SSL/TLS connection using the OpenSSL li...
Definition: MQTTClient.h:671
List::size
size_t size
heap storage used
Definition: LinkedList.h:73
Clients::httpProxy
char * httpProxy
HTTP proxy.
Definition: Clients.h:154
MQTTAsync_SSLOptions::struct_id
char struct_id[4]
The eyecatcher for this structure.
Definition: MQTTAsync.h:1071
MQTTAsync_connectOptions::username
const char * username
MQTT servers that support the MQTT v3.1 protocol provide authentication and authorisation by user nam...
Definition: MQTTAsync.h:1261
Thread_wait_sem
int Thread_wait_sem(sem_type sem, int timeout)
Wait for a semaphore to be posted, or timeout.
Definition: Thread.c:249
Connack::all
unsigned char all
all connack flags
Definition: MQTTPacket.h:138
ListAppendNoMalloc
void ListAppendNoMalloc(List *aList, void *content, ListElement *newel, size_t size)
Append an already allocated ListElement and content to a list.
Definition: LinkedList.c:69
Ack::header
Header header
MQTT header byte.
Definition: MQTTPacket.h:216
pstput
int pstput(void *handle, char *key, int bufcount, char *buffers[], int buflens[])
Write wire message to the client persistence directory.
Definition: MQTTPersistenceDefault.c:195
MQTTPacket_send_connect
int MQTTPacket_send_connect(Clients *client, int MQTTVersion, MQTTProperties *connectProperties, MQTTProperties *willProperties)
Send an MQTT CONNECT packet down a socket for V5 or later.
Definition: MQTTPacketOut.c:48
Clients::inboundMsgs
List * inboundMsgs
inbound in flight messages
Definition: Clients.h:138
Clients::maxInflightMessages
int maxInflightMessages
the max number of inflight outbound messages we allow
Definition: Clients.h:136
Unsuback::header
Header header
MQTT header byte.
Definition: MQTTPacket.h:186
MQTTAsync_disconnectOptions::onSuccess
MQTTAsync_onSuccess * onSuccess
A pointer to a callback function to be called if the disconnect successfully completes.
Definition: MQTTAsync.h:1443
MQTTPersistence_afterRead
int MQTTPersistence_afterRead(void *context, char **buffer, int *buflen)
A callback which is invoked just after a read from persistence.
Definition: MQTTClientPersistence.h:275
MQTTAsync_SSLOptions::verify
int verify
Whether to carry out post-connect checks, including that a certificate matches the given host name.
Definition: MQTTAsync.h:1122
Socket_setnonblocking
int Socket_setnonblocking(SOCKET sock)
Set a socket non-blocking, OS independently.
Definition: Socket.c:82
ListRemove
int ListRemove(List *aList, void *content)
Removes and frees an item in a list by comparing the pointer to the content.
Definition: LinkedList.c:257
MQTTAsync_willOptions::message
const char * message
The LWT payload.
Definition: MQTTAsync.h:1031
MQTTClient_connectOptions::serverURIcount
int serverURIcount
The number of entries in the optional serverURIs array.
Definition: MQTTClient.h:919
Connect::will
bool will
will flag
Definition: MQTTPacket.h:111
Suback
Data for a suback packet.
Definition: MQTTPacket.h:171
MQTTAsync_connectOptions::onSuccess5
MQTTAsync_onSuccess5 * onSuccess5
A pointer to a callback function to be called if the connect successfully completes.
Definition: MQTTAsync.h:1362
heap_info::max_size
size_t max_size
max size the heap has reached in bytes
Definition: Heap.h:65
TreeRemoveNodeIndex
void * TreeRemoveNodeIndex(Tree *aTree, Node *curnode, int index)
Remove an item from a tree.
Definition: Tree.c:420
MQTTClient_connectOptions::will
MQTTClient_willOptions * will
This is a pointer to an MQTTClient_willOptions structure.
Definition: MQTTClient.h:886
Unsuback::msgId
int msgId
MQTT message id.
Definition: MQTTPacket.h:187
MQTTClients
Definition: MQTTClient.c:302
clientIDCompare
int clientIDCompare(void *a, void *b)
List callback function for comparing clients by clientid.
Definition: Clients.c:36
connectionLost_call
static thread_return_type WINAPI connectionLost_call(void *context)
Wrapper function to call connection lost on a separate thread.
Definition: MQTTClient.c:700
MQTTClient_message::qos
int qos
The quality of service (QoS) assigned to the message.
Definition: MQTTClient.h:295
MQTTClient_receive
int MQTTClient_receive(MQTTClient handle, char **topicName, int *topicLen, MQTTClient_message **message, unsigned long timeout)
This function performs a synchronous receive of incoming messages.
Definition: MQTTClient.c:2754
Clients::ping_due
unsigned int ping_due
we couldn't send a ping so we should send one when we can
Definition: Clients.h:129
SocketBuffer_getQueuedData
char * SocketBuffer_getQueuedData(SOCKET socket, size_t bytes, size_t *actual_len)
Get any queued data for a specific socket.
Definition: SocketBuffer.c:176
MQTTAsync_failureData5::packet_type
int packet_type
Packet type on which the failure occurred - used for publish QoS 1/2 exchanges.
Definition: MQTTAsync.h:564
SocketBuffer_freeDefQ
void SocketBuffer_freeDefQ(void)
Free the default queue memory.
Definition: SocketBuffer.c:122
MQTTAsync_command
Definition: MQTTAsyncUtils.h:41
frameData
builds a websocket frame for data transmission
Definition: WebSocket.c:227
SocketBuffer_terminate
void SocketBuffer_terminate(void)
Terminate the socketBuffer module.
Definition: SocketBuffer.c:133
ListFindItem
ListElement * ListFindItem(List *aList, void *content, int(*callback)(void *, void *))
Finds an element in a list by comparing the content or pointer to the content.
Definition: LinkedList.c:154
NodeStruct::size
size_t size
size of content
Definition: Tree.h:82
MQTTAsync_disconnectOptions::context
void * context
Definition: MQTTAsync.h:1455
MQTTAsync_message::struct_id
char struct_id[4]
The eyecatcher for this structure.
Definition: MQTTAsync.h:274
socketcompare
int socketcompare(void *a, void *b)
List callback function for comparing socket_queues by socket.
Definition: SocketBuffer.c:70
MQTTPacket_suback
void * MQTTPacket_suback(int MQTTVersion, unsigned char aHeader, char *data, size_t datalen)
Function used in the new packets table to create suback packets.
Definition: MQTTPacketOut.c:290
props_rc_parms
Definition: MQTTClient.c:337
Publish::topic
char * topic
topic string
Definition: MQTTPacket.h:200
MQTTCLIENT_PERSISTENCE_ERROR
#define MQTTCLIENT_PERSISTENCE_ERROR
Application-specific persistence functions must return this error code if there is a problem executin...
Definition: MQTTClientPersistence.h:85
MQTTClient_setTraceCallback
void MQTTClient_setTraceCallback(MQTTClient_traceCallback *callback)
This function sets the trace callback if needed.
Definition: MQTTClient.c:2941
MQTTProtocol_specialChars
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 o...
Definition: MQTTProtocolOut.c:114
MQTTProtocol_handleDisconnects
int MQTTProtocol_handleDisconnects(void *pack, SOCKET sock)
Process an incoming disconnect packet for a socket.
Definition: MQTTProtocolOut.c:465
pending_write
Definition: MQTTProtocol.h:28
ListRemoveHead
int ListRemoveHead(List *aList)
Removes and frees an the first item in a list.
Definition: LinkedList.c:294
MQTTClient_message::payload
void * payload
A pointer to the payload of the MQTT message.
Definition: MQTTClient.h:281
qEntry
Definition: MQTTAsyncUtils.h:33
readInt4
int readInt4(char **pptr)
Calculates an integer from two bytes read from the input buffer.
Definition: MQTTPacket.c:965
MQTTProperties
MQTT version 5 property list.
Definition: MQTTProperties.h:112
MQTTPacket_sends
int MQTTPacket_sends(networkHandles *net, Header header, PacketBuffers *bufs, int MQTTVersion)
Sends an MQTT packet from multiple buffers in one system call write.
Definition: MQTTPacket.c:253
pstkeys
int pstkeys(void *handle, char ***keys, int *nkeys)
Returns the keys (file names w/o the extension) in the client persistence directory.
Definition: MQTTPersistenceDefault.c:659
MQTTAsync_successData::pub
struct MQTTAsync_successData::@1::@2 pub
For publish, the message being sent to the server.
MQTTCLIENT_PERSISTENCE_USER
#define MQTTCLIENT_PERSISTENCE_USER
This persistence_type value specifies an application-specific persistence mechanism (see MQTTClient_c...
Definition: MQTTClientPersistence.h:79
heap_info
Information about the state of the heap.
Definition: Heap.h:62
Publish::MQTTVersion
int MQTTVersion
the version of MQTT
Definition: MQTTPacket.h:205
MQTTClient_connectOptions::keepAliveInterval
int keepAliveInterval
The "keep alive" interval, measured in seconds, defines the maximum time that should pass without com...
Definition: MQTTClient.h:848
Persistence_get
int(* Persistence_get)(void *handle, char *key, char **buffer, int *buflen)
Retrieve the specified data from the persistent store.
Definition: MQTTClientPersistence.h:156
Messages::len
int len
PUBREC, PUBREL, PUBCOMP
Definition: Clients.h:64
MQTTProtocol_startPublishCommon
static int MQTTProtocol_startPublishCommon(Clients *pubclient, Publish *publish, int qos, int retained)
Utility function to start a new publish exchange.
Definition: MQTTProtocolClient.c:149
SocketBuffer_getQueuedChar
int SocketBuffer_getQueuedChar(SOCKET socket, char *c)
Get any queued character for a specific socket.
Definition: SocketBuffer.c:219
Clients::phandle
void * phandle
the persistence handle
Definition: Clients.h:145
Clients::persistence
MQTTClient_persistence * persistence
a persistence implementation
Definition: Clients.h:146
MQTTClient_connectOptions::serverURIs
char *const * serverURIs
An optional array of null-terminated strings specifying the servers to which the client will connect.
Definition: MQTTClient.h:933
MQTTProtocol_checkPendingWrites
static void MQTTProtocol_checkPendingWrites(void)
See if any pending writes have been completed, and cleanup if so.
Definition: MQTTClient.c:3051
MQTTAsync_createOptions::MQTTVersion
int MQTTVersion
Whether the MQTT version is 3.1, 3.1.1, or 5.
Definition: MQTTAsync.h:981
Clients::httpsProxy
char * httpsProxy
HTTPS proxy.
Definition: Clients.h:155
MQTTAsync_successData::serverURI
char * serverURI
the connection string of the server
Definition: MQTTAsync.h:592
MQTTClient_willOptions::qos
int qos
The quality of service setting for the LWT message (see MQTTClient_message.qos and qos).
Definition: MQTTClient.h:643
Clients::net
networkHandles net
network info for this client
Definition: Clients.h:132
Connack::reserved
unsigned int reserved
message type nibble
Definition: MQTTPacket.h:149
Persistence_close
int(* Persistence_close)(void *handle)
Close the persistent store referred to by the handle.
Definition: MQTTClientPersistence.h:123
MQTTPacket
Data for a packet with header only.
Definition: MQTTPacket.h:162
MQTTAsync_failureData5::code
int code
A numeric code identifying the MQTT client library error.
Definition: MQTTAsync.h:560
MQTTProtocol_freeMessageList
void MQTTProtocol_freeMessageList(List *msgList)
Empty and free up all storage used by a message list.
Definition: MQTTProtocolClient.c:994
SocketBuffer_pendingWrite
int SocketBuffer_pendingWrite(SOCKET socket, int count, iobuf *iovecs, int *frees, size_t total, size_t bytes)
A socket write was interrupted so store the remaining data.
Definition: SocketBuffer.c:349
MQTTPacket_send_publish
int MQTTPacket_send_publish(Publish *pack, int dup, int qos, int retained, networkHandles *net, const char *clientID)
Send an MQTT PUBLISH packet down a socket.
Definition: MQTTPacket.c:855
MQTTAsync_connectOptions::MQTTVersion
int MQTTVersion
Sets the version of MQTT to be used on the connect.
Definition: MQTTAsync.h:1325
Unsuback
Data for an MQTT V5 unsuback packet.
Definition: MQTTPacket.h:184
MQTTAsync_disconnectOptions::struct_id
char struct_id[4]
The eyecatcher for this structure.
Definition: MQTTAsync.h:1430
MQTTAsync_SSLOptions::privateKey
const char * privateKey
If not included in the sslKeyStore, this setting points to the file in PEM format containing the clie...
Definition: MQTTAsync.h:1093
MQTTPacket_ack
void * MQTTPacket_ack(int MQTTVersion, unsigned char aHeader, char *data, size_t datalen)
Function used in the new packets table to create acknowledgement packets.
Definition: MQTTPacket.c:794
MQTTClient_subscribeMany5
MQTTResponse MQTTClient_subscribeMany5(MQTTClient handle, int count, char *const *topic, int *qos, MQTTSubscribe_options *opts, MQTTProperties *props)
This function attempts to subscribe an MQTT version 5.0 client to a list of topics,...
Definition: MQTTClient.c:2008
Socket_addSocket
int Socket_addSocket(SOCKET newSd)
Add a socket to the list of socket to check with select.
Definition: Socket.c:266
MQTTClient_message
A structure representing the payload and attributes of an MQTT message.
Definition: MQTTClient.h:271
MQTTAsync_successData5::destinationName
char * destinationName
the topic destination for the message
Definition: MQTTAsync.h:622
MQTTPersistence_initialize
int MQTTPersistence_initialize(Clients *c, const char *serverURI)
Open persistent store and restore any persisted messages.
Definition: MQTTPersistence.c:115
Clients::afterRead
MQTTPersistence_afterRead * afterRead
persistence read callback
Definition: Clients.h:148
ListDetach
int ListDetach(List *aList, void *content)
Removes but does not free an item in a list by comparing the pointer to the content.
Definition: LinkedList.c:245
Log
void Log(enum LOG_LEVELS log_level, int msgno, const char *format,...)
Log a message.
Definition: Log.c:425
MQTTProtocol_connect
int MQTTProtocol_connect(const char *ip_address, Clients *aClient, int websocket, int MQTTVersion, MQTTProperties *connectProperties, MQTTProperties *willProperties)
MQTT outgoing connect processing for a client.
Definition: MQTTProtocolOut.c:217
MQTTClient_createWithOptions
int MQTTClient_createWithOptions(MQTTClient *handle, const char *serverURI, const char *clientId, int persistence_type, void *persistence_context, MQTTClient_createOptions *options)
A version of :MQTTClient_create() with additional options.
Definition: MQTTClient.c:373
ListFreeNoContent
void ListFreeNoContent(List *aList)
Removes and but does not free all items in a list, and frees the list itself.
Definition: LinkedList.c:392
MQTTPersistence_putPacket
int MQTTPersistence_putPacket(SOCKET socket, char *buf0, size_t buf0len, int count, char **buffers, size_t *buflens, int htype, int msgId, int scr, int MQTTVersion)
Adds a record to the persistent store.
Definition: MQTTPersistence.c:434
NodeStruct::content
void * content
pointer to element content
Definition: Tree.h:81
MQTTClient_SSLOptions::CApath
const char * CApath
From the OpenSSL documentation: If CApath is not NULL, it points to a directory containing CA certifi...
Definition: MQTTClient.h:732
MQTTAsync_createOptions::allowDisconnectedSendAtAnyTime
int allowDisconnectedSendAtAnyTime
Allow sending of messages while disconnected before a first successful connect.
Definition: MQTTAsync.h:985
Clients::ping_due_time
START_TIME_TYPE ping_due_time
the time at which the ping should have been sent (ping_due)
Definition: Clients.h:131
MQTTClient_publish
int MQTTClient_publish(MQTTClient handle, const char *topicName, int payloadlen, const void *payload, int qos, int retained, MQTTClient_deliveryToken *deliveryToken)
This function attempts to publish a message to a given topic (see also MQTTClient_publishMessage()).
Definition: MQTTClient.c:2463
MQTTClient_nameValue
MQTTClient_libraryInfo is used to store details relating to the currently used library such as the ve...
Definition: MQTTClient.h:791
MQTTProperty::identifier
enum MQTTPropertyCodes identifier
The MQTT V5 property id.
Definition: MQTTProperties.h:96
Connect::header
Header header
MQTT header byte.
Definition: MQTTPacket.h:91
MQTTPacket_freeUnsuback
void MQTTPacket_freeUnsuback(Unsuback *pack)
Free allocated storage for a suback packet.
Definition: MQTTPacket.c:711
MQTTCLIENT_PERSISTENCE_NONE
#define MQTTCLIENT_PERSISTENCE_NONE
This persistence_type value specifies a memory-based persistence mechanism (see MQTTClient_create()).
Definition: MQTTClientPersistence.h:74
MQTTClient_connectOptions::binarypwd
struct MQTTClient_connectOptions::@19 binarypwd
Optional binary password.
MQTTAsync_responseOptions::struct_id
char struct_id[4]
The eyecatcher for this structure.
Definition: MQTTAsync.h:711
Connack::rc
unsigned char rc
connack reason code
Definition: MQTTPacket.h:153
MQTTAsync_SSLOptions::trustStore
const char * trustStore
The file in PEM format containing the public digital certificates trusted by the client.
Definition: MQTTAsync.h:1083
storageElement::line
int line
the line no in the source file where it was allocated
Definition: Heap.c:71
ListNextElement
ListElement * ListNextElement(List *aList, ListElement **pos)
Forward iteration through a list.
Definition: LinkedList.c:411
Suback::MQTTVersion
int MQTTVersion
the version of MQTT
Definition: MQTTPacket.h:175
Connect::version
unsigned char version
MQTT version number.
Definition: MQTTPacket.h:126
MQTTPersistence_qEntry
Definition: MQTTPersistence.h:84
MQTTAsync_createOptions::struct_id
char struct_id[4]
The eyecatcher for this structure.
Definition: MQTTAsync.h:963
stackEntry
Definition: StackTrace.c:46
MQTTPersistence_create
int MQTTPersistence_create(MQTTClient_persistence **persistence, int type, void *pcontext)
Creates a MQTTClient_persistence structure representing a persistence implementation.
Definition: MQTTPersistence.c:51
MQTTProperty::value
MQTTLenString value
The value of a user property.
Definition: MQTTProperties.h:104
Thread_destroy_mutex
int Thread_destroy_mutex(mutex_type mutex)
Destroy a mutex which has already been created.
Definition: Thread.c:181
MQTTStrncpy
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 b...
Definition: MQTTProtocolClient.c:1056
Ack::properties
MQTTProperties properties
MQTT 5.0 properties.
Definition: MQTTPacket.h:220
writeData
void writeData(char **pptr, const void *data, int datalen)
Writes length delimited data to an output buffer.
Definition: MQTTPacket.c:482
MQTTAsync_SSLOptions
MQTTAsync_sslProperties defines the settings to establish an SSL/TLS connection using the OpenSSL lib...
Definition: MQTTAsync.h:1068
MQTTAsync_failureData5::message
const char * message
Optional further text explaining the error.
Definition: MQTTAsync.h:562
MQTTAsync_willOptions::struct_id
char struct_id[4]
The eyecatcher for this structure.
Definition: MQTTAsync.h:1023
Log_nameValue
Definition: Log.h:77
MQTTClient_publishMessage
int MQTTClient_publishMessage(MQTTClient handle, const char *topicName, MQTTClient_message *message, MQTTClient_deliveryToken *deliveryToken)
This function attempts to publish a message to a given topic (see also MQTTClient_publish()).
Definition: MQTTClient.c:2508
Connack::sessionPresent
bool sessionPresent
was a session found on the server?
Definition: MQTTPacket.h:148
Connect::willMsg
char * willMsg
will payload
Definition: MQTTPacket.h:123
Thread_create_cond
cond_type Thread_create_cond(int *rc)
Create a new condition variable.
Definition: Thread.c:384
Clients::connect_count
int connect_count
the number of outbound messages on reconnect - to ensure we send them all
Definition: Clients.h:140
Heap_terminate
void Heap_terminate(void)
Heap termination.
Definition: Heap.c:417
AckRequest
Definition: MQTTProtocolClient.c:61
Sockets::fds_read
struct pollfd * fds_read
poll read file descriptors
Definition: Socket.h:126
call_disconnected
static thread_return_type WINAPI call_disconnected(void *context)
Wrapper function to call disconnected on a separate thread.
Definition: MQTTClient.c:738
MQTTAsync_successData5::properties
MQTTProperties properties
MQTT V5 properties returned, if any.
Definition: MQTTAsync.h:608
Tree::indexes
int indexes
no of indexes into tree
Definition: Tree.h:83
MQTTAsync_successData5::struct_version
int struct_version
The version number of this structure.
Definition: MQTTAsync.h:604
MQTTClient_disconnect1
static int MQTTClient_disconnect1(MQTTClient handle, int timeout, int internal, int stop, enum MQTTReasonCodes, MQTTProperties *)
mqttclient_mutex must be locked when you call this function, if multi threaded
Definition: MQTTClient.c:1909
PacketBuffers::mask
uint8_t mask[4]
array of flags indicating whether each buffer needs to be freed
Definition: Socket.h:105
UTF8_validate
int UTF8_validate(int len, const char *data)
Validate a length-delimited string has only UTF-8 characters.
Definition: utf-8.c:129
PacketBuffers
Definition: Socket.h:99
MQTTAsync_connectOptions::onSuccess
MQTTAsync_onSuccess * onSuccess
A pointer to a callback function to be called if the connect successfully completes.
Definition: MQTTAsync.h:1290
Ack::msgId
int msgId
MQTT message id.
Definition: MQTTPacket.h:217
MQTTClient_yield
void MQTTClient_yield(void)
When implementing a single-threaded client, call this function periodically to allow processing of me...
Definition: MQTTClient.c:2810
MQTTAsync_connectData
The connect options that can be updated before an automatic reconnect.
Definition: MQTTAsync.h:465
MQTTAsync_connectOptions::serverURIcount
int serverURIcount
The number of entries in the serverURIs array.
Definition: MQTTAsync.h:1306
MQTTClient_willOptions::retained
int retained
The retained flag for the LWT message (see MQTTClient_message.retained).
Definition: MQTTClient.h:638
MQTTAsync_createOptions
Options for the ::MQTTAsync_createWithOptions call.
Definition: MQTTAsync.h:960
Socket_outInitialize
void Socket_outInitialize(void)
Initialize the socket module.
Definition: Socket.c:130
MQTTProperty::integer4
unsigned int integer4
holds the value of a 4 byte integer property type
Definition: MQTTProperties.h:101
Connect::keepAliveTimer
int keepAliveTimer
keepalive timeout value in seconds
Definition: MQTTPacket.h:125
Thread_wait_cond
int Thread_wait_cond(cond_type condvar, int timeout_ms)
Wait with a timeout (ms) for condition variable.
Definition: Thread.c:435
MQTTAsync_willOptions::topicName
const char * topicName
The LWT topic to which the LWT message will be published.
Definition: MQTTAsync.h:1029
MQTTPacket_freeSuback
void MQTTPacket_freeSuback(Suback *pack)
Free allocated storage for a suback packet.
Definition: MQTTPacket.c:695
Thread_getid
thread_id_type Thread_getid(void)
Get the thread id of the thread from which this function is called.
Definition: Thread.c:201
Publications
Stored publication data to minimize copying.
Definition: Clients.h:41
pstget
int pstget(void *handle, char *key, char **buffer, int *buflen)
Retrieve a wire message from the client persistence directory.
Definition: MQTTPersistenceDefault.c:257
MQTTClient_willOptions
MQTTClient_willOptions defines the MQTT "Last Will and Testament" (LWT) settings for the client.
Definition: MQTTClient.h:623
MQTTAsync_SSLOptions::keyStore
const char * keyStore
The file in PEM format containing the public certificate chain of the client.
Definition: MQTTAsync.h:1088
MQTTClient_SSLOptions::struct_id
char struct_id[4]
The eyecatcher for this structure.
Definition: MQTTClient.h:674
MQTTAsync_successData5::reasonCodes
enum MQTTReasonCodes * reasonCodes
an array of reasonCodes
Definition: MQTTAsync.h:616
MQTTClient_unsubscribeMany5
MQTTResponse MQTTClient_unsubscribeMany5(MQTTClient handle, int count, char *const *topic, MQTTProperties *props)
This function attempts to remove existing subscriptions to a list of topics made by the specified cli...
Definition: MQTTClient.c:2188
Thread_check_sem
int Thread_check_sem(sem_type sem)
Check to see if a semaphore has been posted, without waiting The semaphore will be unchanged,...
Definition: Thread.c:311
MQTTAsync_connectOptions::context
void * context
Definition: MQTTAsync.h:1302
Publish
Data for a publish packet.
Definition: MQTTPacket.h:197
MQTTClient_publishMessage5
MQTTResponse MQTTClient_publishMessage5(MQTTClient handle, const char *topicName, MQTTClient_message *message, MQTTClient_deliveryToken *deliveryToken)
Attempts to publish a message to the given topic using MQTT version 5.0 (see also MQTTClient_publish5...
Definition: MQTTClient.c:2477
Tree::size
size_t size
heap storage used
Definition: Tree.h:85
MQTTAsync_responseOptions
Structure to define call options.
Definition: MQTTAsync.h:708
clientSocketCompare
int clientSocketCompare(void *a, void *b)
List callback function for comparing clients by socket.
Definition: Clients.c:50
MQTTClient_connectOptions
MQTTClient_connectOptions defines several settings that control the way the client connects to an MQT...
Definition: MQTTClient.h:824
MQTTClient_subscribe
int MQTTClient_subscribe(MQTTClient handle, const char *topic, int qos)
This function attempts to subscribe a client to a single topic, which may contain wildcards (see wild...
Definition: MQTTClient.c:2174
MQTTProtocol_createMessage
Messages * MQTTProtocol_createMessage(Publish *publish, Messages **mm, int qos, int retained, int allocatePayload)
Copy and store message data for retries.
Definition: MQTTProtocolClient.c:206
MQTTProtocol_handlePingresps
int MQTTProtocol_handlePingresps(void *pack, SOCKET sock)
Process an incoming pingresp packet for a socket.
Definition: MQTTProtocolOut.c:365
MQTTClient_isConnected
int MQTTClient_isConnected(MQTTClient handle)
This function allows the client application to test whether or not a client is currently connected to...
Definition: MQTTClient.c:1993
MQTTAsync_connectOptions::ssl
MQTTAsync_SSLOptions * ssl
This is a pointer to an MQTTAsync_SSLOptions structure.
Definition: MQTTAsync.h:1284
MQTTAsync_failureData::message
const char * message
Optional text explaining the error.
Definition: MQTTAsync.h:542
queues
static List * queues
List of queued input buffers.
Definition: SocketBuffer.c:50
pending_writes
Definition: SocketBuffer.h:44
MQTTProtocol_closeSession
void MQTTProtocol_closeSession(Clients *c, int sendwill)
mqttclient_mutex must be locked when you call this function, if multi threaded
Definition: MQTTClient.c:1965
Clients::sessionExpiry
int sessionExpiry
MQTT 5 session expiry.
Definition: Clients.h:153
MQTTAsync_createOptions::sendWhileDisconnected
int sendWhileDisconnected
Whether to allow messages to be sent when the client library is not connected.
Definition: MQTTAsync.h:971
MQTTAsync_successData::MQTTVersion
int MQTTVersion
the version of MQTT being used
Definition: MQTTAsync.h:593
writes
static List writes
List of queued write buffers.
Definition: SocketBuffer.c:55
MQTTClient_free
void MQTTClient_free(void *memory)
This function frees memory allocated by the MQTT C client library, especially the topic name.
Definition: MQTTClient.c:639
MQTTPersistence_message
Definition: MQTTPersistence.h:71
MQTTPacket_freeConnack
void MQTTPacket_freeConnack(Connack *pack)
Free allocated storage for a connack packet.
Definition: MQTTPacketOut.c:185
HeapScan
static void HeapScan(enum LOG_LEVELS log_level)
Scans the heap and reports any items currently allocated.
Definition: Heap.c:383
TreeInitialize
Tree * TreeInitialize(int(*compare)(void *, void *, int))
Allocates and initializes a new tree structure.
Definition: Tree.c:65
MQTTAsync_connectOptions::connectProperties
MQTTProperties * connectProperties
MQTT V5 properties for connect.
Definition: MQTTAsync.h:1352
valid_ranges
struct @34 valid_ranges[]
Structure to hold the valid ranges of UTF-8 characters, for each byte up to 4.
MQTTClient_SSLOptions::ssl_psk_cb
unsigned int(* ssl_psk_cb)(const char *hint, char *identity, unsigned int max_identity_len, unsigned char *psk, unsigned int max_psk_len, void *u)
Callback function for setting TLS-PSK options.
Definition: MQTTClient.h:751
MQTTClient_setTraceLevel
void MQTTClient_setTraceLevel(enum MQTTCLIENT_TRACE_LEVELS level)
This function sets the level of trace information which will be returned in the trace callback.
Definition: MQTTClient.c:2935
Tree::allow_duplicates
unsigned int allow_duplicates
switch to allow duplicate entries
Definition: Tree.h:87
MQTTAsync_connectOptions::cleansession
int cleansession
This is a boolean value.
Definition: MQTTAsync.h:1245
MQTTClient_persistence::pput
Persistence_put pput
A function pointer to an implementation of Persistence_put().
Definition: MQTTClientPersistence.h:231
MQTTAsync_failureData5::reasonCode
enum MQTTReasonCodes reasonCode
The MQTT reason code returned.
Definition: MQTTAsync.h:556
TreeRemoveIndex
void * TreeRemoveIndex(Tree *aTree, void *content, int index)
Remove an item from a tree.
Definition: Tree.c:487
MQTTClient_SSLOptions::verify
int verify
Whether to carry out post-connect checks, including that a certificate matches the given host name.
Definition: MQTTClient.h:725
MQTTClient_connectOptions::ssl
MQTTClient_SSLOptions * ssl
This is a pointer to an MQTTClient_SSLOptions structure.
Definition: MQTTClient.h:915
MQTTPersistence_remove
int MQTTPersistence_remove(Clients *c, char *type, int qos, int msgId)
Deletes a record from the persistent store.
Definition: MQTTPersistence.c:533
Sockets::nfds
unsigned int nfds
no of file descriptors for poll
Definition: Socket.h:125
trace_settings_type::max_trace_entries
int max_trace_entries
max no of entries in the trace buffer
Definition: Log.h:66
MQTTClient_willOptions::len
int len
binary payload length
Definition: MQTTClient.h:647
lower
char lower
lower limit of valid range
Definition: utf-8.c:49
List::count
int count
no of items
Definition: LinkedList.h:72
MQTTAsync_message
A structure representing the payload and attributes of an MQTT message.
Definition: MQTTAsync.h:271
socket_queue
Definition: SocketBuffer.h:33
MQTTClient_message::dup
int dup
The dup flag indicates whether or not this message is a duplicate.
Definition: MQTTClient.h:321
MQTTAsync_disconnectOptions::onFailure5
MQTTAsync_onFailure5 * onFailure5
A pointer to a callback function to be called if the disconnect fails.
Definition: MQTTAsync.h:1475
MQTTAsync_SSLOptions::ssl_error_cb
int(* ssl_error_cb)(const char *str, size_t len, void *u)
Callback function for OpenSSL error handler ERR_print_errors_cb Exists only if struct_version >= 3.
Definition: MQTTAsync.h:1135
MQTTAsync_successData::token
MQTTAsync_token token
A token identifying the successful request.
Definition: MQTTAsync.h:573
MQTTAsync_SSLOptions::ssl_psk_cb
unsigned int(* ssl_psk_cb)(const char *hint, char *identity, unsigned int max_identity_len, unsigned char *psk, unsigned int max_psk_len, void *u)
Callback function for setting TLS-PSK options.
Definition: MQTTAsync.h:1148
Thread_signal_cond
int Thread_signal_cond(cond_type condvar)
Signal a condition variable.
Definition: Thread.c:418
MQTTClient_init_options
Initialization options.
Definition: MQTTClient.h:229
Connack::header
Header header
MQTT header byte.
Definition: MQTTPacket.h:135
stringcompare
int stringcompare(void *a, void *b)
List callback function for comparing C strings.
Definition: LinkedList.c:448
MQTTAsync_connectOptions::password
const char * password
MQTT servers that support the MQTT v3.1 protocol provide authentication and authorisation by user nam...
Definition: MQTTAsync.h:1267
MQTTAsync_connectData::len
int len
binary password length
Definition: MQTTAsync.h:484
ptrCompare
static int ptrCompare(void *a, void *b, int value)
List callback function for comparing storage elements.
Definition: Heap.c:114
Unsuback::reasonCodes
List * reasonCodes
list of reason codes
Definition: MQTTPacket.h:190
Connect::flags
union Connect::@21 flags
connect flags byte
MQTTClient_connectOptions::returned
struct MQTTClient_connectOptions::@18 returned
Returned from the connect when the MQTT version used to connect is 3.1.1.
Socket_putdatas
int Socket_putdatas(SOCKET socket, char *buf0, size_t buf0len, PacketBuffers bufs)
Attempts to write a series of buffers to a socket in one system call so that they are sent as one pac...
Definition: Socket.c:762
MQTTAsync_failureData::code
int code
A numeric code identifying the error.
Definition: MQTTAsync.h:540
MQTTAsync_responseOptions::onSuccess
MQTTAsync_onSuccess * onSuccess
A pointer to a callback function to be called if the API call successfully completes.
Definition: MQTTAsync.h:720
MQTTClient_willOptions::topicName
const char * topicName
The LWT topic to which the LWT message will be published.
Definition: MQTTClient.h:632
MQTTAsync_successData::qos
int qos
For subscribe, the granted QoS of the subscription returned by the server.
Definition: MQTTAsync.h:579
Heap_get_info
heap_info * Heap_get_info(void)
Access to heap state.
Definition: Heap.c:432
Socket_getpeer
char * Socket_getpeer(SOCKET sock)
Get information about the other end connected to a socket.
Definition: Socket.c:1469
MQTTAsync_willOptions::qos
int qos
The quality of service setting for the LWT message (see MQTTAsync_message.qos and qos).
Definition: MQTTAsync.h:1040
MQTTClient_SSLOptions::trustStore
const char * trustStore
The file in PEM format containing the public digital certificates trusted by the client.
Definition: MQTTClient.h:686
Connect::willRetain
bool willRetain
will retain setting
Definition: MQTTPacket.h:113
MQTTClient_subscribe5
MQTTResponse MQTTClient_subscribe5(MQTTClient handle, const char *topic, int qos, MQTTSubscribe_options *opts, MQTTProperties *props)
This function attempts to subscribe an MQTT version 5.0 client to a single topic, which may contain w...
Definition: MQTTClient.c:2160
MQTTClient_SSLOptions::keyStore
const char * keyStore
The file in PEM format containing the public certificate chain of the client.
Definition: MQTTClient.h:691
Ack::MQTTVersion
int MQTTVersion
the version of MQTT
Definition: MQTTPacket.h:219
MQTTClient_connectOptions::reliable
int reliable
This is a boolean value that controls how many messages can be in-flight simultaneously.
Definition: MQTTClient.h:880
MQTTCLIENT_PERSISTENCE_DEFAULT
#define MQTTCLIENT_PERSISTENCE_DEFAULT
This persistence_type value specifies the default file system-based persistence mechanism (see MQTTCl...
Definition: MQTTClientPersistence.h:69
MQTTClient_connectOptions::cleansession
int cleansession
This is a boolean value.
Definition: MQTTClient.h:870
MQTTAsync_connectData::data
const void * data
binary password data
Definition: MQTTAsync.h:485
trace_settings_type::trace_level
enum LOG_LEVELS trace_level
trace level
Definition: Log.h:65
Sockets::connect_pending
List * connect_pending
list of sockets for which a connect is pending
Definition: Socket.h:114
MQTTAsync_SSLOptions::ssl_error_context
void * ssl_error_context
Application-specific contex for OpenSSL error handler ERR_print_errors_cb Exists only if struct_versi...
Definition: MQTTAsync.h:1141
Header::qos
unsigned int qos
QoS value, 0, 1 or 2.
Definition: MQTTPacket.h:78
Header::type
unsigned int type
message type nibble
Definition: MQTTPacket.h:80
MQTTPersistence_insertInOrder
void MQTTPersistence_insertInOrder(List *list, void *content, size_t size)
Inserts the specified message into the list, maintaining message ID order.
Definition: MQTTPersistence.c:401
Persistence_keys
int(* Persistence_keys)(void *handle, char ***keys, int *nkeys)
Returns the keys in this persistent data store.
Definition: MQTTClientPersistence.h:186
MQTTAsync_message::dup
int dup
The dup flag indicates whether or not this message is a duplicate.
Definition: MQTTAsync.h:321
MQTTAsync_disconnectOptions::onFailure
MQTTAsync_onFailure * onFailure
A pointer to a callback function to be called if the disconnect fails.
Definition: MQTTAsync.h:1449
MQTTAsync_connectOptions::struct_id
char struct_id[4]
The eyecatcher for this structure.
Definition: MQTTAsync.h:1201
ListElementStruct
Structure to hold all data for one list element.
Definition: LinkedList.h:56
MQTTPacket::header
Header header
MQTT header byte.
Definition: MQTTPacket.h:164
ListRemoveItem
int ListRemoveItem(List *aList, void *content, int(*callback)(void *, void *))
Removes and frees an element in a list by comparing the content.
Definition: LinkedList.c:349
Sockets::cur_fd
int cur_fd
index into the fds_saved array
Definition: Socket.h:130
NodeStruct::child
struct NodeStruct * child[2]
pointers to child tree nodes 0 = left, 1 = right
Definition: Tree.h:80
Connect::cleanstart
bool cleanstart
cleansession flag
Definition: MQTTPacket.h:110
ClientStates
Configuration data related to all clients.
Definition: Clients.h:168
MQTTAsync_SSLOptions::enableServerCertAuth
int enableServerCertAuth
True/False option to enable verification of the server certificate.
Definition: MQTTAsync.h:1109
storageElement::size
size_t size
size of the allocated storage
Definition: Heap.c:73
readUTF
char * readUTF(char **pptr, char *enddata)
Reads a "UTF" string from the input buffer.
Definition: MQTTPacket.c:416
Socket_getaddrname
char * Socket_getaddrname(struct sockaddr *sa, SOCKET sock)
Convert a numeric address to character string.
Definition: Socket.c:1431
MQTTClient_destroy
void MQTTClient_destroy(MQTTClient *handle)
This function frees the memory allocated to an MQTT client (see MQTTClient_create()).
Definition: MQTTClient.c:583
MQTTAsync_message::payload
void * payload
A pointer to the payload of the MQTT message.
Definition: MQTTAsync.h:281
MQTTClient_SSLOptions::enableServerCertAuth
int enableServerCertAuth
True/False option to enable verification of the server certificate.
Definition: MQTTClient.h:712
Clients::good
unsigned int good
if we have an error on the socket we turn this off
Definition: Clients.h:127
MQTTPacket_connack
void * MQTTPacket_connack(int MQTTVersion, unsigned char aHeader, char *data, size_t datalen)
Function used in the new packets table to create connack packets.
Definition: MQTTPacketOut.c:142
MQTTAsync_willOptions::retained
int retained
The retained flag for the LWT message (see MQTTAsync_message.retained).
Definition: MQTTAsync.h:1035
MQTTLenString
The data for a length delimited string.
Definition: MQTTProperties.h:84
MQTTClient_persistence::pclose
Persistence_close pclose
A function pointer to an implementation of Persistence_close().
Definition: MQTTClientPersistence.h:227
MQTTAsync_connectOptions::connectTimeout
int connectTimeout
The time interval in seconds to allow a connect to complete.
Definition: MQTTAsync.h:1271
Messages::nextMessageType
char nextMessageType
used for retry and expiry
Definition: Clients.h:63
MQTTPacket_unsuback
void * MQTTPacket_unsuback(int MQTTVersion, unsigned char aHeader, char *data, size_t datalen)
Function used in the new packets table to create unsuback packets.
Definition: MQTTPacketOut.c:411
Socket_continueWrite
int Socket_continueWrite(SOCKET socket)
Continue an outstanding write for a particular socket.
Definition: Socket.c:1232
MQTTClient_subscribeMany
int MQTTClient_subscribeMany(MQTTClient handle, int count, char *const *topic, int *qos)
This function attempts to subscribe a client to a list of topics, which may contain wildcards (see wi...
Definition: MQTTClient.c:2145
MQTTClient_connectOptions::struct_version
int struct_version
The version number of this structure.
Definition: MQTTClient.h:838
MQTTAsync_connectOptions::httpHeaders
const MQTTAsync_nameValue * httpHeaders
HTTP headers for websockets.
Definition: MQTTAsync.h:1372
ListZero
void ListZero(List *newl)
Sets a list structure to empty - all null values.
Definition: LinkedList.c:42
Socket_error
int Socket_error(char *aString, SOCKET sock)
Gets the specific error corresponding to SOCKET_ERROR.
Definition: Socket.c:109
Socket_continueWrites
int Socket_continueWrites(SOCKET *socket, mutex_type mutex)
Continue any outstanding socket writes.
Definition: Socket.c:1363
MQTTPacket_freeAck
void MQTTPacket_freeAck(Ack *pack)
Free allocated storage for an ack packet.
Definition: MQTTPacket.c:628
socket_queue::fixed_header
char fixed_header[5]
header plus up to 4 length bytes
Definition: SocketBuffer.h:38
MQTTAsync_failureData5
The data returned on completion of an unsuccessful API call in the response callback onFailure.
Definition: MQTTAsync.h:547
MQTTClient_connectOptions::httpsProxy
const char * httpsProxy
HTTPS proxy.
Definition: MQTTClient.h:978
SocketBuffer_updateWrite
pending_writes * SocketBuffer_updateWrite(SOCKET socket, char *topic, char *payload)
Update the queued write data for a socket in the case of QoS 0 messages.
Definition: SocketBuffer.c:424
MQTTClient_connectOptions::data
const void * data
binary password data
Definition: MQTTClient.h:957
MQTTAsync_responseOptions::onFailure
MQTTAsync_onFailure * onFailure
A pointer to a callback function to be called if the API call fails.
Definition: MQTTAsync.h:726
MQTTAsync_createOptions::maxBufferedMessages
int maxBufferedMessages
The maximum number of messages allowed to be buffered.
Definition: MQTTAsync.h:975
MQTTClient_connectOptions::serverURI
const char * serverURI
the serverURI connected to
Definition: MQTTClient.h:947
lines_written
static int lines_written
number of lines written to the current output file
Definition: Log.c:106
MQTTAsync_connectOptions::will
MQTTAsync_willOptions * will
This is a pointer to an MQTTAsync_willOptions structure.
Definition: MQTTAsync.h:1255
MQTTProtocol_keepalive
void MQTTProtocol_keepalive(START_TIME_TYPE now)
MQTT protocol keepAlive processing.
Definition: MQTTProtocolClient.c:700
MQTTProtocol_handlePubrecs
int MQTTProtocol_handlePubrecs(void *pack, SOCKET sock, Publications **pubToRemove)
Process an incoming pubrec packet for a socket.
Definition: MQTTProtocolClient.c:485
Tree::count
int count
no of items
Definition: Tree.h:84
Heap_roundup
static size_t Heap_roundup(size_t size)
Round allocation size up to a multiple of the size of an int.
Definition: Heap.c:98
MQTTClient_message::msgid
int msgid
The message identifier is normally reserved for internal use by the MQTT client and server.
Definition: MQTTClient.h:325
MQTTClient_connectOptions::MQTTVersion
int MQTTVersion
Sets the version of MQTT to be used on the connect.
Definition: MQTTClient.h:941
MQTTClient_SSLOptions::disableDefaultTrustStore
int disableDefaultTrustStore
Don't load default SSL CA.
Definition: MQTTClient.h:764
MQTTAsync_successData::message
MQTTAsync_message message
the message being sent to the server
Definition: MQTTAsync.h:586
MQTTAsync_message::retained
int retained
The retained flag serves two purposes depending on whether the message it is associated with is being...
Definition: MQTTAsync.h:314
MQTTClient_setDisconnected
int MQTTClient_setDisconnected(MQTTClient handle, void *context, MQTTClient_disconnected *disconnected)
Sets the MQTTClient_disconnected() callback function for a client.
Definition: MQTTClient.c:709
MQTTAsync_successData5::alt
union MQTTAsync_successData5::@4 alt
A union of the different values that can be returned for subscribe, unsubscribe and publish.
MQTTSubscribe_options::retainAsPublished
unsigned char retainAsPublished
To keep the retain flag as on the original publish message, set to 1.
Definition: MQTTSubscribeOpts.h:50
ws_frame::len
size_t len
length of frame
Definition: WebSocket.c:146
Ack::rc
unsigned char rc
MQTT 5 reason code.
Definition: MQTTPacket.h:218
MQTTAsync_responseOptions::struct_version
int struct_version
The version number of this structure.
Definition: MQTTAsync.h:714
Connack
Data for a connack packet.
Definition: MQTTPacket.h:133
Thread_destroy_sem
int Thread_destroy_sem(sem_type sem)
Destroy a semaphore which has already been created.
Definition: Thread.c:360
MQTTProtocol_retry
void MQTTProtocol_retry(START_TIME_TYPE now, int doRetry, int regardless)
MQTT retry protocol and socket pending writes processing.
Definition: MQTTProtocolClient.c:877
MQTTClient_createOptions::MQTTVersion
int MQTTVersion
Whether the MQTT version is 3.1, 3.1.1, or 5.
Definition: MQTTClient.h:559
Clients::context
void * context
calling context - used when calling disconnect_internal
Definition: Clients.h:151
MQTTClient_disconnect
int MQTTClient_disconnect(MQTTClient handle, int timeout)
This function attempts to disconnect the client from the MQTT server.
Definition: MQTTClient.c:1971
SocketBuffer_cleanup
void SocketBuffer_cleanup(SOCKET socket)
Cleanup any buffers for a specific socket.
Definition: SocketBuffer.c:151
Clients::MQTTVersion
int MQTTVersion
the version of MQTT being used, 3, 4 or 5
Definition: Clients.h:152
Sockets
Structure to hold all socket data for the module.
Definition: Socket.h:112
Tree::heap_tracking
unsigned int heap_tracking
switch on heap tracking for this tree?
Definition: Tree.h:86
MQTTAsync_connectOptions::len
int len
binary password length
Definition: MQTTAsync.h:1342
MQTTClient_SSLOptions::privateKey
const char * privateKey
If not included in the sslKeyStore, this setting points to the file in PEM format containing the clie...
Definition: MQTTClient.h:696
MQTTClient_SSLOptions::enabledCipherSuites
const char * enabledCipherSuites
The list of cipher suites that the client will present to the server during the SSL handshake.
Definition: MQTTClient.h:709
writeChar
void writeChar(char **pptr, char c)
Writes one character to an output buffer.
Definition: MQTTPacket.c:441
MQTTLenString::len
int len
the length of the string
Definition: MQTTProperties.h:86
MQTTAsync_SSLOptions::privateKeyPassword
const char * privateKeyPassword
The password to load the client's privateKey if encrypted.
Definition: MQTTAsync.h:1096
MQTTProtocol_retries
static void MQTTProtocol_retries(START_TIME_TYPE now, Clients *client, int regardless)
MQTT retry processing per client.
Definition: MQTTProtocolClient.c:767
MQTTAsync_disconnectOptions::struct_version
int struct_version
The version number of this structure.
Definition: MQTTAsync.h:1432
MQTTPacket_send_subscribe
int MQTTPacket_send_subscribe(List *topics, List *qoss, MQTTSubscribe_options *opts, MQTTProperties *props, int msgid, int dup, Clients *client)
Send an MQTT subscribe packet down a socket.
Definition: MQTTPacketOut.c:226
MQTTAsync_disconnectOptions::timeout
int timeout
The client delays disconnection for up to this time (in milliseconds) in order to allow in-flight mes...
Definition: MQTTAsync.h:1437
ARRAY_SIZE
#define ARRAY_SIZE(a)
Macro to determine the number of elements in a single-dimension array.
Definition: utf-8.c:37
MQTTAsync_SSLOptions::enabledCipherSuites
const char * enabledCipherSuites
The list of cipher suites that the client will present to the server during the SSL handshake.
Definition: MQTTAsync.h:1106
MQTTAsync_failureData5::struct_version
int struct_version
The version number of this structure.
Definition: MQTTAsync.h:552
MQTTClient_SSLOptions::ssl_error_context
void * ssl_error_context
Application-specific contex for OpenSSL error handler ERR_print_errors_cb Exists only if struct_versi...
Definition: MQTTClient.h:744
SocketBuffer_interrupted
void SocketBuffer_interrupted(SOCKET socket, size_t actual_len)
A socket read was interrupted so we need to queue data.
Definition: SocketBuffer.c:252
MQTTAsync_disconnectOptions::properties
MQTTProperties properties
MQTT V5 input properties.
Definition: MQTTAsync.h:1459
MQTTAsync_successData5::reasonCode
enum MQTTReasonCodes reasonCode
MQTT V5 reason code returned.
Definition: MQTTAsync.h:607
MQTTClient_unsubscribeMany
int MQTTClient_unsubscribeMany(MQTTClient handle, int count, char *const *topic)
This function attempts to remove existing subscriptions to a list of topics made by the specified cli...
Definition: MQTTClient.c:2292
MQTTClient_setCallbacks
int MQTTClient_setCallbacks(MQTTClient handle, void *context, MQTTClient_connectionLost *cl, MQTTClient_messageArrived *ma, MQTTClient_deliveryComplete *dc)
This function sets the callback functions for a specific client.
Definition: MQTTClient.c:1059
MQTTAsync_successData5::pub
struct MQTTAsync_successData5::@4::@6 pub
For publish, the message being sent to the server.
MQTTAsync_createOptions::struct_version
int struct_version
The version number of this structure.
Definition: MQTTAsync.h:969
Connect::clientID
char * clientID
string client id
Definition: MQTTPacket.h:121
MQTTClient_connectOptions::struct_id
char struct_id[4]
The eyecatcher for this structure.
Definition: MQTTClient.h:827
MQTTAsync_SSLOptions::sslVersion
int sslVersion
The SSL/TLS version to use.
Definition: MQTTAsync.h:1115
MQTTClient_unsubscribe
int MQTTClient_unsubscribe(MQTTClient handle, const char *topic)
This function attempts to remove an existing subscription made by the specified client.
Definition: MQTTClient.c:2315
Connect::password
bool password
3.1 password
Definition: MQTTPacket.h:114
Socket_close_only
int Socket_close_only(SOCKET socket)
Close a socket without removing it from the select list.
Definition: Socket.c:862
Suback::msgId
int msgId
MQTT message id.
Definition: MQTTPacket.h:174
Persistence_put
int(* Persistence_put)(void *handle, char *key, int bufcount, char *buffers[], int buflens[])
Put the specified data into the persistent store.
Definition: MQTTClientPersistence.h:140
MQTTClient_willOptions::payload
struct MQTTClient_willOptions::@17 payload
The LWT payload in binary form.
Publish::payloadlen
int payloadlen
payload length
Definition: MQTTPacket.h:204
MQTTAsync_successData::alt
union MQTTAsync_successData::@1 alt
A union of the different values that can be returned for subscribe, unsubscribe and publish.
MQTTAsync_connectOptions::maxInflight
int maxInflight
This controls how many messages can be in-flight simultaneously.
Definition: MQTTAsync.h:1249
Clients::will
willMessages * will
the MQTT will message, if any
Definition: Clients.h:137
Connect
Data for a connect packet.
Definition: MQTTPacket.h:89
MQTTAsync_SSLOptions::disableDefaultTrustStore
int disableDefaultTrustStore
Don't load default SSL CA.
Definition: MQTTAsync.h:1161
MQTTProtocol_queueAck
static int MQTTProtocol_queueAck(Clients *client, int ackType, int msgId)
Queue an ack message.
Definition: MQTTProtocolClient.c:850
MQTTClient_message::struct_version
int struct_version
The version number of this structure.
Definition: MQTTClient.h:277
SocketBuffer_complete
char * SocketBuffer_complete(SOCKET socket)
A socket read has now completed so we can get rid of the queue.
Definition: SocketBuffer.c:281
ListEmpty
void ListEmpty(List *aList)
Removes and frees all items in a list, leaving the list ready for new items.
Definition: LinkedList.c:359
MQTTClient_init_options::struct_version
int struct_version
The version number of this structure.
Definition: MQTTClient.h:234
MQTTSubscribe_options::struct_version
int struct_version
The version number of this structure.
Definition: MQTTSubscribeOpts.h:41
messageIDCompare
int messageIDCompare(void *a, void *b)
List callback function for comparing Message structures by message id.
Definition: MQTTProtocolClient.c:73
UTF8_char_validate
static const char * UTF8_char_validate(int len, const char *data)
Validate a single UTF-8 character.
Definition: utf-8.c:76
MQTTClient_init_options::do_openssl_init
int do_openssl_init
1 = we do openssl init, 0 = leave it to the application
Definition: MQTTClient.h:236
MQTTAsync_successData5
The data returned on completion of a successful API call in the response callback onSuccess.
Definition: MQTTAsync.h:601
MQTTAsync_SSLOptions::CApath
const char * CApath
From the OpenSSL documentation: If CApath is not NULL, it points to a directory containing CA certifi...
Definition: MQTTAsync.h:1129
MQTTClient_persistence::pkeys
Persistence_keys pkeys
A function pointer to an implementation of Persistence_keys().
Definition: MQTTClientPersistence.h:243
readChar
unsigned char readChar(char **pptr)
Reads one character from the input buffer.
Definition: MQTTPacket.c:428
SocketBuffer_queueChar
void SocketBuffer_queueChar(SOCKET socket, char c)
Queued a Charactor to a specific socket.
Definition: SocketBuffer.c:303
MQTTProperties::max_count
int max_count
max number of properties that the currently allocated array can store
Definition: MQTTProperties.h:115
MQTTProtocol_handlePubrels
int MQTTProtocol_handlePubrels(void *pack, SOCKET sock)
Process an incoming pubrel packet for a socket.
Definition: MQTTProtocolClient.c:565
heap
static Tree heap
Tree that holds the allocation records.
Definition: Heap.c:79
MQTTClient_connect5
MQTTResponse MQTTClient_connect5(MQTTClient handle, MQTTClient_connectOptions *options, MQTTProperties *connectProperties, MQTTProperties *willProperties)
Attempts to connect a previously-created client (see MQTTClient_create()) to an MQTT server using MQT...
Definition: MQTTClient.c:1714
MQTTAsync_disconnectOptions
Options for the ::MQTTAsync_disconnect call.
Definition: MQTTAsync.h:1427
MQTTClient_persistence::premove
Persistence_remove premove
A function pointer to an implementation of Persistence_remove().
Definition: MQTTClientPersistence.h:239
MQTTClient_getVersionInfo
MQTTClient_nameValue * MQTTClient_getVersionInfo(void)
This function returns version information about the library.
Definition: MQTTClient.c:2962
Publish::properties
MQTTProperties properties
MQTT 5.0 properties.
Definition: MQTTPacket.h:206
Unsuback::properties
MQTTProperties properties
MQTT 5.0 properties.
Definition: MQTTPacket.h:189
MQTTProtocol_startPublish
int MQTTProtocol_startPublish(Clients *pubclient, Publish *publish, int qos, int retained, Messages **mm)
Start a new publish exchange.
Definition: MQTTProtocolClient.c:171
MQTTClient_message::payloadlen
int payloadlen
The length of the MQTT message payload in bytes.
Definition: MQTTClient.h:279
trace_destination
static FILE * trace_destination
flag to indicate if trace is to be sent to a stream
Definition: Log.c:103
networkHandles
Definition: Clients.h:79
SocketBuffer_newDefQ
int SocketBuffer_newDefQ(void)
Create a new default queue when one has just been used.
Definition: SocketBuffer.c:79
MQTTClient_strerror
const char * MQTTClient_strerror(int code)
Returns a pointer to the string representation of the error or NULL.
Definition: MQTTClient.c:2998
Tree::root
Node * root
root node pointer
Definition: Tree.h:80
MQTTProperty::byte
unsigned char byte
holds the value of a byte property type
Definition: MQTTProperties.h:99
ListInitialize
List * ListInitialize(void)
Allocates and initializes a new list structure.
Definition: LinkedList.c:52
HeapDump
int HeapDump(FILE *file)
Dump the state of the heap.
Definition: Heap.c:462
Clients::username
const char * username
MQTT v3.1 user name.
Definition: Clients.h:121
ws_frame
raw websocket frame data
Definition: WebSocket.c:144
pstcontainskey
int pstcontainskey(void *handle, char *key)
Returns whether if a wire message is persisted in the client persistence directory.
Definition: MQTTPersistenceDefault.c:405
Header::dup
bool dup
DUP flag bit.
Definition: MQTTPacket.h:79
willMessages
Client will message data.
Definition: Clients.h:70
SocketBuffer_writeComplete
int SocketBuffer_writeComplete(SOCKET socket)
A socket write has now completed so we can get rid of the queue.
Definition: SocketBuffer.c:411
Thread_destroy_cond
int Thread_destroy_cond(cond_type condvar)
Destroy a condition variable.
Definition: Thread.c:475
MQTTClient_connectOptions::maxInflightMessages
int maxInflightMessages
The maximum number of messages in flight.
Definition: MQTTClient.h:962
pstclose
int pstclose(void *handle)
Delete client persistence directory (if empty).
Definition: MQTTPersistenceDefault.c:371
MQTTAsync_connectOptions::serverURIs
char *const * serverURIs
Definition: MQTTAsync.h:1318
MQTTAsync_connectOptions::maxRetryInterval
int maxRetryInterval
The maximum automatic reconnect retry interval in seconds.
Definition: MQTTAsync.h:1337
MQTTClient_willOptions::struct_id
char struct_id[4]
The eyecatcher for this structure.
Definition: MQTTClient.h:626
MQTTAsync_connectOptions::keepAliveInterval
int keepAliveInterval
The "keep alive" interval, measured in seconds, defines the maximum time that should pass without com...
Definition: MQTTAsync.h:1223
MQTTProtocol_handlePublishes
int MQTTProtocol_handlePublishes(void *pack, SOCKET sock)
Process an incoming publish packet for a socket The payload field of the packet has not been transfer...
Definition: MQTTProtocolClient.c:323
ListInsert
ListElement * ListInsert(List *aList, void *content, size_t size, ListElement *index)
Insert an item to a list at a specific position.
Definition: LinkedList.c:107
Clients::cleanstart
unsigned int cleanstart
MQTT V5 clean start flag.
Definition: Clients.h:125
MQTTClient_message::struct_id
char struct_id[4]
The eyecatcher for this structure.
Definition: MQTTClient.h:274
ListPopTail
void * ListPopTail(List *aList)
Removes but does not free the last item in a list.
Definition: LinkedList.c:306
Suback::header
Header header
MQTT header byte.
Definition: MQTTPacket.h:173
Publish::payload
char * payload
binary payload, length delimited
Definition: MQTTPacket.h:203
Clients::connect_sent
int connect_sent
the current number of outbound messages on reconnect that we've sent
Definition: Clients.h:141
SocketBuffer_getWrite
pending_writes * SocketBuffer_getWrite(SOCKET socket)
Get any queued write data for a specific socket.
Definition: SocketBuffer.c:399
MQTTAsync_SSLOptions::ssl_psk_context
void * ssl_psk_context
Application-specific contex for ssl_psk_cb Exists only if struct_version >= 4.
Definition: MQTTAsync.h:1154
Clients::password
const void * password
MQTT v3.1 binary password.
Definition: Clients.h:123
MQTTProtocol_writeAvailable
void MQTTProtocol_writeAvailable(SOCKET socket)
Callback that is invoked when the socket is available for writing.
Definition: MQTTProtocolClient.c:1009
SocketBuffer_initialize
int SocketBuffer_initialize(void)
Initialize the socketBuffer module.
Definition: SocketBuffer.c:102
MQTTPacket_send_pubcomp
int MQTTPacket_send_pubcomp(int MQTTVersion, int msgid, networkHandles *net, const char *clientID)
Send an MQTT PUBCOMP packet down a socket.
Definition: MQTTPacket.c:774
MQTTClient_willOptions::struct_version
int struct_version
The version number of this structure.
Definition: MQTTClient.h:630
Clients::messageQueue
List * messageQueue
inbound complete but undelivered messages
Definition: Clients.h:142
Clients::cleansession
unsigned int cleansession
MQTT V3 clean session flag.
Definition: Clients.h:124
MQTTAsync_successData5::MQTTVersion
int MQTTVersion
the version of MQTT being used
Definition: MQTTAsync.h:628
MQTTPacket_send_pubrec
int MQTTPacket_send_pubrec(int MQTTVersion, int msgid, networkHandles *net, const char *clientID)
Send an MQTT PUBREC packet down a socket.
Definition: MQTTPacket.c:733
MQTTPacket_send
int MQTTPacket_send(networkHandles *net, Header header, char *buffer, size_t buflen, int freeData, int MQTTVersion)
Sends an MQTT packet in one system call write.
Definition: MQTTPacket.c:193
MQTTAsync_message::msgid
int msgid
The message identifier is reserved for internal use by the MQTT client and server.
Definition: MQTTAsync.h:327
MQTTAsync_nameValue::value
const char * value
value string
Definition: MQTTAsync.h:1185
Thread_create_sem
sem_type Thread_create_sem(int *rc)
Create a new semaphore.
Definition: Thread.c:216
MQTTClient_SSLOptions::protos_len
unsigned int protos_len
The length of the vector protos vector Exists only if struct_version >= 5.
Definition: MQTTClient.h:779
Socket_close
int Socket_close(SOCKET socket)
Close a socket and remove it from the select list.
Definition: Socket.c:935
max_lines_per_file
static int max_lines_per_file
maximum number of lines to write to one trace file
Definition: Log.c:107
Tree
Structure to hold all data for one tree.
Definition: Tree.h:76
storageElement::ptr
void * ptr
pointer to the allocated storage
Definition: Heap.c:72
Clients::outboundMsgs
List * outboundMsgs
outbound in flight messages
Definition: Clients.h:139
storageElement
Each item on the heap is recorded with this structure.
Definition: Heap.c:68
MQTTAsync_connectData::username
const char * username
MQTT servers that support the MQTT v3.1 protocol provide authentication and authorisation by user nam...
Definition: MQTTAsync.h:477
MQTTClient_createOptions
Options for the MQTTClient_createWithOptions call.
Definition: MQTTClient.h:548
MQTTProtocol_storePublication
Publications * MQTTProtocol_storePublication(Publish *publish, int *len)
Store message data for possible retry.
Definition: MQTTProtocolClient.c:262
MQTTClient_SSLOptions::ssl_error_cb
int(* ssl_error_cb)(const char *str, size_t len, void *u)
Callback function for OpenSSL error handler ERR_print_errors_cb Exists only if struct_version >= 3.
Definition: MQTTClient.h:738
MQTTClient_persistence::popen
Persistence_open popen
A function pointer to an implementation of Persistence_open().
Definition: MQTTClientPersistence.h:223
Thread_post_sem
int Thread_post_sem(sem_type sem)
Post a semaphore.
Definition: Thread.c:332
Socket_writev
int Socket_writev(SOCKET socket, iobuf *iovecs, int count, unsigned long *bytes)
Attempts to write a series of iovec buffers to a socket in one system call so that they are sent as o...
Definition: Socket.c:690
UTF8_validateString
int UTF8_validateString(const char *string)
Validate a null-terminated string has only UTF-8 characters.
Definition: utf-8.c:156
Socket_getch
int Socket_getch(SOCKET socket, char *c)
Reads one byte from a socket.
Definition: Socket.c:589
MQTTPacket_encode
int MQTTPacket_encode(char *buf, size_t length)
Encodes the message length according to the MQTT algorithm.
Definition: MQTTPacket.c:300
MQTTAsync_successData::destinationName
char * destinationName
the topic destination for the message
Definition: MQTTAsync.h:587
MQTTAsync_connectData::struct_version
int struct_version
The version number of this structure.
Definition: MQTTAsync.h:470
Clients::connected
unsigned int connected
whether it is currently connected
Definition: Clients.h:126
ListAppend
ListElement * ListAppend(List *aList, void *content, size_t size)
Append an item to a list.
Definition: LinkedList.c:90
MQTTProtocol_handleUnsubacks
int MQTTProtocol_handleUnsubacks(void *pack, SOCKET sock)
Process an incoming unsuback packet for a socket.
Definition: MQTTProtocolOut.c:444
MQTTProtocol_addressPort
size_t MQTTProtocol_addressPort(const char *uri, int *port, const char **topic, int default_port)
Separates an address:port into two separate values.
Definition: MQTTProtocolOut.c:56
heap_info::current_size
size_t current_size
current size of the heap in bytes
Definition: Heap.h:64
Clients::beforeWrite_context
void * beforeWrite_context
context to be used with the persistence beforeWrite callbacks
Definition: Clients.h:149
MQTTSubscribe_options::struct_id
char struct_id[4]
The eyecatcher for this structure.
Definition: MQTTSubscribeOpts.h:38
ListUnlink
static int ListUnlink(List *aList, void *content, int(*callback)(void *, void *), int freeContent)
Removes and optionally frees an element in a list by comparing the content.
Definition: LinkedList.c:201
MQTTAsync_connectOptions::retryInterval
int retryInterval
The time interval in seconds after which unacknowledged publish requests are retried during a TCP ses...
Definition: MQTTAsync.h:1279
MQTTProtocol_emptyMessageList
void MQTTProtocol_emptyMessageList(List *msgList)
Empty a message list, leaving it able to accept new messages.
Definition: MQTTProtocolClient.c:973
Header::retain
bool retain
retained flag bit
Definition: MQTTPacket.h:77
packet_names
static const char * packet_names[]
List of the predefined MQTT v3/v5 packet names.
Definition: MQTTPacket.c:50
MQTTProtocol_unsubscribe
int MQTTProtocol_unsubscribe(Clients *client, List *topics, int msgID, MQTTProperties *props)
MQTT outgoing unsubscribe processing for a client.
Definition: MQTTProtocolOut.c:427
_unlink
#define _unlink
_unlink mapping for linux
Definition: Log.c:59
PacketBuffers::buffers
char ** buffers
number of buffers/buflens/frees
Definition: Socket.h:102
Clients::outboundQueue
List * outboundQueue
outbound queued messages
Definition: Clients.h:143
readUTFlen
static char * readUTFlen(char **pptr, char *enddata, int *len)
Reads a "UTF" string from the input buffer.
Definition: MQTTPacket.c:383
MQTTClient_connectOptions::password
const char * password
MQTT servers that support the MQTT v3.1.1 protocol provide authentication and authorisation by user n...
Definition: MQTTClient.h:898
MQTTPacket_send_unsubscribe
int MQTTPacket_send_unsubscribe(List *topics, MQTTProperties *props, int msgid, int dup, Clients *client)
Send an MQTT unsubscribe packet down a socket.
Definition: MQTTPacketOut.c:362
MQTTClient_connectOptions::username
const char * username
MQTT servers that support the MQTT v3.1.1 protocol provide authentication and authorisation by user n...
Definition: MQTTClient.h:892
Ack
Data for one of the ack packets.
Definition: MQTTPacket.h:214
MQTTStrdup
char * MQTTStrdup(const char *src)
Duplicate a string, safely, allocating space on the heap.
Definition: MQTTProtocolClient.c:1081
MQTTPacket_header_only
void * MQTTPacket_header_only(int MQTTVersion, unsigned char aHeader, char *data, size_t datalen)
Function used in the new packets table to create packets which have only a header.
Definition: MQTTPacket.c:498
Socket_outTerminate
void Socket_outTerminate(void)
Terminate the socket module.
Definition: Socket.c:171
MQTTAsync_queuedCommand
Definition: MQTTAsyncUtils.h:149
nameToType
Definition: MQTTProperties.c:28
MQTTAsync_connectOptions::httpProxy
const char * httpProxy
HTTP proxy.
Definition: MQTTAsync.h:1376
MQTTClient_persistence::pcontainskey
Persistence_containskey pcontainskey
A function pointer to an implementation of Persistence_containskey().
Definition: MQTTClientPersistence.h:251
MQTTSubscribe_options::retainHandling
unsigned char retainHandling
0 - send retained messages at the time of the subscribe (original MQTT behaviour) 1 - send retained m...
Definition: MQTTSubscribeOpts.h:55
MQTTClient_create
int MQTTClient_create(MQTTClient *handle, const char *serverURI, const char *clientId, int persistence_type, void *persistence_context)
This function creates an MQTT client ready for connection to the specified server and using the speci...
Definition: MQTTClient.c:534
MQTTAsync_disconnectOptions::onSuccess5
MQTTAsync_onSuccess5 * onSuccess5
A pointer to a callback function to be called if the disconnect successfully completes.
Definition: MQTTAsync.h:1469
MQTTPersistence_restoreMessageQueue
int MQTTPersistence_restoreMessageQueue(Clients *c)
Restores a queue of messages from persistence to memory.
Definition: MQTTPersistence.c:856
Messages_get
const char * Messages_get(int index, enum LOG_LEVELS log_level)
Get a log message by its index.
Definition: Messages.c:95
MQTTAsync_SSLOptions::struct_version
int struct_version
The version number of this structure.
Definition: MQTTAsync.h:1080
readInt
int readInt(char **pptr)
Calculates an integer from two bytes read from the input buffer.
Definition: MQTTPacket.c:362
trace_settings_type
Definition: Log.h:63
TreeAddByIndex
void * TreeAddByIndex(Tree *aTree, void *content, size_t size, int index)
Add an item to a tree.
Definition: Tree.c:210
networkHandles::websocket
int websocket
socket has been upgraded to use web sockets
Definition: Clients.h:93
MQTTClient_SSLOptions::privateKeyPassword
const char * privateKeyPassword
The password to load the client's privateKey if encrypted.
Definition: MQTTClient.h:699
MQTTAsync_init_options
Initialization options.
Definition: MQTTAsync.h:231
MQTTClient_persistence::pclear
Persistence_clear pclear
A function pointer to an implementation of Persistence_clear().
Definition: MQTTClientPersistence.h:247
MQTTPersistence_wrapMsgID
void MQTTPersistence_wrapMsgID(Clients *client)
Checks whether the message IDs wrapped by looking for the largest gap between two consecutive message...
Definition: MQTTPersistence.c:605
MQTTAsync_message::qos
int qos
The quality of service (QoS) assigned to the message.
Definition: MQTTAsync.h:295
MQTTAsync_failureData::token
MQTTAsync_token token
A token identifying the failed request.
Definition: MQTTAsync.h:538
Publish::msgId
int msgId
MQTT message id.
Definition: MQTTPacket.h:202
state
static heap_info state
global heap state information
Definition: Heap.c:58
MQTTClient_connectOptions::retryInterval
int retryInterval
The time interval in seconds after which unacknowledged publish requests are retried during a TCP ses...
Definition: MQTTClient.h:910
Tree::compare
int(* compare)(void *, void *, int)
comparison function
Definition: Tree.h:81
MQTTAsync_responseOptions::token
MQTTAsync_token token
A token is returned from the call.
Definition: MQTTAsync.h:739
Suback::qoss
List * qoss
list of granted QoSs (MQTT 3/4) / reason codes (MQTT 5)
Definition: MQTTPacket.h:177
MQTTAsync_SSLOptions::protos
const unsigned char * protos
The protocol-lists must be in wire-format, which is defined as a vector of non-empty,...
Definition: MQTTAsync.h:1170
Thread_lock_mutex
int Thread_lock_mutex(mutex_type mutex)
Lock a mutex which has alrea.
Definition: Thread.c:137
pending_socketcompare
int pending_socketcompare(void *a, void *b)
List callback function for comparing pending_writes by socket.
Definition: SocketBuffer.c:388
Clients::afterRead_context
void * afterRead_context
context to be used with the persistence afterRead callback
Definition: Clients.h:150
MQTTClient_unsubscribe5
MQTTResponse MQTTClient_unsubscribe5(MQTTClient handle, const char *topic, MQTTProperties *props)
This function attempts to remove an existing subscription made by the specified client using MQTT 5....
Definition: MQTTClient.c:2306
Clients::msgID
int msgID
the MQTT message id
Definition: Clients.h:133
MQTTClient_SSLOptions::protos
const unsigned char * protos
The protocol-lists must be in wire-format, which is defined as a vector of non-empty,...
Definition: MQTTClient.h:773
MQTTPersistence_clear
int MQTTPersistence_clear(Clients *c)
Clears the persistent store.
Definition: MQTTPersistence.c:166
def_queue
static socket_queue * def_queue
Default input queue buffer.
Definition: SocketBuffer.c:45
Publish::mask
uint8_t mask[4]
the websockets mask the payload is masked with, if any
Definition: MQTTPacket.h:207
Log_stackTrace
void Log_stackTrace(enum LOG_LEVELS log_level, int msgno, thread_id_type thread_id, int current_depth, const char *name, int line, int *rc)
The reason for this function is to make trace logging as fast as possible so that the function exit/e...
Definition: Log.c:456
MQTTPacket_send_ack
static int MQTTPacket_send_ack(int MQTTVersion, int type, int msgid, int dup, networkHandles *net)
Send an MQTT acknowledgement packet down a socket.
Definition: MQTTPacket.c:647
Clients::passwordlen
int passwordlen
MQTT password length.
Definition: Clients.h:122
MQTTClient_message::properties
MQTTProperties properties
The MQTT V5 properties associated with the message.
Definition: MQTTClient.h:329
MQTTAsync_nameValue::name
const char * name
name string
Definition: MQTTAsync.h:1184
PacketBuffers::frees
int * frees
array of lengths of buffers
Definition: Socket.h:104
MQTTClient_getPendingDeliveryTokens
int MQTTClient_getPendingDeliveryTokens(MQTTClient handle, MQTTClient_deliveryToken **tokens)
This function sets a pointer to an array of delivery tokens for messages that are currently in-flight...
Definition: MQTTClient.c:2894
MQTTPersistence_close
int MQTTPersistence_close(Clients *c)
Close persistent store.
Definition: MQTTPersistence.c:137
MQTTAsync_message::properties
MQTTProperties properties
The MQTT V5 properties associated with the message.
Definition: MQTTAsync.h:331
Suback::properties
MQTTProperties properties
MQTT 5.0 properties.
Definition: MQTTPacket.h:176
MQTTAsync_connectOptions::onFailure5
MQTTAsync_onFailure5 * onFailure5
A pointer to a callback function to be called if the connect fails.
Definition: MQTTAsync.h:1368
pstremove
int pstremove(void *handle, char *key)
Delete a persisted message from the client persistence directory.
Definition: MQTTPersistenceDefault.c:322
MQTTAsync_failureData5::properties
MQTTProperties properties
The MQTT properties on the ack, if any.
Definition: MQTTAsync.h:558
MQTTAsync_connectOptions::willProperties
MQTTProperties * willProperties
MQTT V5 properties for the will message in the connect.
Definition: MQTTAsync.h:1356
MQTTAsync_successData
The data returned on completion of a successful API call in the response callback onSuccess.
Definition: MQTTAsync.h:570
MQTTClient_persistence
A structure containing the function pointers to a persistence implementation and the context or state...
Definition: MQTTClientPersistence.h:215
Clients::keepAliveInterval
int keepAliveInterval
the MQTT keep alive interval
Definition: Clients.h:134
MQTTAsync_successData5::sub
struct MQTTAsync_successData5::@4::@5 sub
For subscribeMany, the list of reasonCodes returned by the server.
Unsuback::MQTTVersion
int MQTTVersion
the version of MQTT
Definition: MQTTPacket.h:188
MQTTAsync_failureData
The data returned on completion of an unsuccessful API call in the response callback onFailure.
Definition: MQTTAsync.h:535
Header
Bitfields for the MQTT header byte.
Definition: MQTTPacket.h:63
List
Structure to hold all data for one list.
Definition: LinkedList.h:67
Socket_addPendingWrite
void Socket_addPendingWrite(SOCKET socket)
Add a socket to the pending write list, so that it is checked for writing in select.
Definition: Socket.c:836
MQTTProperty
Structure to hold an MQTT version 5 property of any type.
Definition: MQTTProperties.h:94
MQTTClientPersistence.h
This structure represents a persistent data store, used to store outbound and inbound messages,...
MQTTClient_connectOptions::httpProxy
const char * httpProxy
HTTP proxy.
Definition: MQTTClient.h:974
cond_type_struct
Definition: Thread.h:55
MQTTClient_publish5
MQTTResponse MQTTClient_publish5(MQTTClient handle, const char *topicName, int payloadlen, const void *payload, int qos, int retained, MQTTProperties *properties, MQTTClient_deliveryToken *deliveryToken)
Attempts to publish a message to a given topic using MQTT version 5.0 (see also MQTTClient_publishMes...
Definition: MQTTClient.c:2323
MQTTClient_willOptions::message
const char * message
The LWT payload in string form.
Definition: MQTTClient.h:634
Clients::beforeWrite
MQTTPersistence_beforeWrite * beforeWrite
persistence write callback
Definition: Clients.h:147
MQTTAsync_disconnectOptions::reasonCode
enum MQTTReasonCodes reasonCode
Reason code for MQTTV5 disconnect.
Definition: MQTTAsync.h:1463
Connack::properties
MQTTProperties properties
MQTT 5.0 properties.
Definition: MQTTPacket.h:155
MQTTAsync_connectData::binarypwd
struct MQTTAsync_connectData::@0 binarypwd
The password parameter of the MQTT authentication.
MQTTAsync_connectOptions::binarypwd
struct MQTTAsync_connectOptions::@10 binarypwd
Optional binary password.
MQTTPacket_free_packet
void MQTTPacket_free_packet(MQTTPacket *pack)
Free allocated storage for a various packet tyoes.
Definition: MQTTPacket.c:925
MQTTAsync_connectOptions::httpsProxy
const char * httpsProxy
HTTPS proxy.
Definition: MQTTAsync.h:1380
mymalloc
void * mymalloc(char *file, int line, size_t size)
Allocates a block of memory.
Definition: Heap.c:158
len
int len
number of elements in the following array (1 to 4)
Definition: utf-8.c:46
MQTTAsync_connectOptions
MQTTAsync_connectOptions defines several settings that control the way the client connects to an MQTT...
Definition: MQTTAsync.h:1198
Socket_getdata
char * Socket_getdata(SOCKET socket, size_t bytes, size_t *actual_len, int *rc)
Attempts to read a number of bytes from a socket, non-blocking.
Definition: Socket.c:627
MQTTAsync_responseOptions::context
void * context
A pointer to any application-specific context.
Definition: MQTTAsync.h:732
socket_queue::buflen
size_t buflen
total length of the buffer
Definition: SocketBuffer.h:39
MQTTResponse
MQTT version 5.0 response information.
Definition: MQTTClient.h:1024
MQTTAsync_SSLOptions::protos_len
unsigned int protos_len
The length of the vector protos vector Exists only if struct_version >= 5.
Definition: MQTTAsync.h:1176
List::last
ListElement * last
last element in the list
Definition: LinkedList.h:70
MQTTClient_createOptions::struct_id
char struct_id[4]
The eyecatcher for this structure.
Definition: MQTTClient.h:551
Clients
Data related to one client.
Definition: Clients.h:118
Clients::retryInterval
int retryInterval
the MQTT retry interval for QoS > 0
Definition: Clients.h:135
ListFind
ListElement * ListFind(List *aList, void *content)
Finds an element in a list by comparing the content pointers, rather than the contents.
Definition: LinkedList.c:140
Heap_unlink
void Heap_unlink(char *file, int line, void *p)
Remove an item from the recorded heap without actually freeing it.
Definition: Heap.c:300
ws_frame::pos
size_t pos
current position within the buffer
Definition: WebSocket.c:147
Thread_unlock_mutex
int Thread_unlock_mutex(mutex_type mutex)
Unlock a mutex which has already been locked.
Definition: Thread.c:158
List::first
ListElement * first
first element in the list
Definition: LinkedList.h:69
new_packets
pf new_packets[]
Array of functions to build packets, indexed according to packet code.
Definition: MQTTPacket.c:73
MQTTClient_persistence::context
void * context
A pointer to any data required to initialize the persistent store.
Definition: MQTTClientPersistence.h:219
Heap_initialize
int Heap_initialize(void)
Heap initialization.
Definition: Heap.c:406
Connect::willTopic
char * willTopic
will topic
Definition: MQTTPacket.h:122
MQTTAsync_willOptions::data
const void * data
binary payload data
Definition: MQTTAsync.h:1045
Thread_create_mutex
mutex_type Thread_create_mutex(int *rc)
Create a new mutex.
Definition: Thread.c:114
MQTTSubscribe_options::noLocal
unsigned char noLocal
To not receive our own publications, set to 1.
Definition: MQTTSubscribeOpts.h:45
MQTTAsync_connectOptions::onFailure
MQTTAsync_onFailure * onFailure
A pointer to a callback function to be called if the connect fails.
Definition: MQTTAsync.h:1296
MQTTAsync_responseOptions::onFailure5
MQTTAsync_onFailure5 * onFailure5
A pointer to a callback function to be called if the API call successfully completes.
Definition: MQTTAsync.h:751
MQTTPacket_freePublish
void MQTTPacket_freePublish(Publish *pack)
Free allocated storage for a publish packet.
Definition: MQTTPacket.c:612
writeUTF
void writeUTF(char **pptr, const char *string)
Writes a "UTF" string to an output buffer.
Definition: MQTTPacket.c:467
ListPrevElement
ListElement * ListPrevElement(List *aList, ListElement **pos)
Backward iteration through a list.
Definition: LinkedList.c:424
MQTTProperties::count
int count
number of property entries in the array
Definition: MQTTProperties.h:114
mod_s
Sockets mod_s
Structure to hold all socket data for this module.
Definition: Socket.c:72
Connect::Protocol
char * Protocol
MQTT protocol name.
Definition: MQTTPacket.h:120
MQTTPacket_name
const char * MQTTPacket_name(int ptype)
Converts an MQTT packet code into its name.
Definition: MQTTPacket.c:65
writeInt
void writeInt(char **pptr, int anInt)
Writes an integer as 2 bytes to an output buffer.
Definition: MQTTPacket.c:453
MQTTPacket_send_pubrel
int MQTTPacket_send_pubrel(int MQTTVersion, int msgid, int dup, networkHandles *net, const char *clientID)
Send an MQTT PUBREL packet down a socket.
Definition: MQTTPacket.c:754
MQTTProperties::array
MQTTProperty * array
array of properties
Definition: MQTTProperties.h:117
MQTTClient_freeMessage
void MQTTClient_freeMessage(MQTTClient_message **message)
This function frees memory allocated to an MQTT message, including the additional memory allocated to...
Definition: MQTTClient.c:628
MQTTAsync_connectOptions::data
const void * data
binary password data
Definition: MQTTAsync.h:1343
MQTTProtocol_handlePubcomps
int MQTTProtocol_handlePubcomps(void *pack, SOCKET sock, Publications **pubToRemove)
Process an incoming pubcomp packet for a socket.
Definition: MQTTProtocolClient.c:642
Connack::flags
union Connack::@23 flags
connack flags byte
Header::byte
char byte
the whole byte
Definition: MQTTPacket.h:65
threadEntry
Definition: StackTrace.c:53
MQTTAsync_command::MQTTVersion
int MQTTVersion
current MQTT version being used to connect
Definition: MQTTAsyncUtils.h:84
trace_destination_name
static char * trace_destination_name
the name of the trace file
Definition: Log.c:104
MQTTProtocol_handlePubacks
int MQTTProtocol_handlePubacks(void *pack, SOCKET sock, Publications **pubToRemove)
Process an incoming puback packet for a socket.
Definition: MQTTProtocolClient.c:436
MQTTAsync_successData5::message
MQTTAsync_message message
the message being sent to the server
Definition: MQTTAsync.h:621
upper
char upper
upper limit of valid range
Definition: utf-8.c:50
MQTTClient_message::retained
int retained
The retained flag serves two purposes depending on whether the message it is associated with is being...
Definition: MQTTClient.h:314
ListDetachItem
int ListDetachItem(List *aList, void *content, int(*callback)(void *, void *))
Removes but does not free an element in a list by comparing the content.
Definition: LinkedList.c:335
MQTTClient_connect
int MQTTClient_connect(MQTTClient handle, MQTTClient_connectOptions *options)
This function attempts to connect a previously-created client (see MQTTClient_create()) to an MQTT se...
Definition: MQTTClient.c:1700
MQTTAsync_successData5::reasonCodeCount
int reasonCodeCount
the number of reason codes in the reasonCodes array
Definition: MQTTAsync.h:615
isReady
int isReady(int index)
Don't accept work from a client unless it is accepting work back, i.e.
Definition: Socket.c:344
MQTTClient_SSLOptions::struct_version
int struct_version
The version number of this structure.
Definition: MQTTClient.h:683
Internal_heap_unlink
static int Internal_heap_unlink(char *file, int line, void *p)
Remove an item from the recorded heap without actually freeing it.
Definition: Heap.c:245
FindString
char * FindString(char *filename, const char *eyecatcher_input)
Finds an eyecatcher in a binary file and returns the following value.
Definition: MQTTVersion.c:74
MQTTAsync_responseOptions::properties
MQTTProperties properties
MQTT V5 input properties.
Definition: MQTTAsync.h:755
Persistence_open
int(* Persistence_open)(void **handle, const char *clientID, const char *serverURI, void *context)
Initialize the persistent store.
Definition: MQTTClientPersistence.h:113
traceEntry
Definition: Log.c:80
MQTTPacket_Factory
void * MQTTPacket_Factory(int MQTTVersion, networkHandles *net, int *error)
Reads one MQTT packet from a socket.
Definition: MQTTPacket.c:103
MQTTClient_SSLOptions::sslVersion
int sslVersion
The SSL/TLS version to use.
Definition: MQTTClient.h:718
pstopen
int pstopen(void **handle, const char *clientID, const char *serverURI, void *context)
Create persistence directory for the client: context/clientID-serverURI.
Definition: MQTTPersistenceDefault.c:65
SHA_CTX_S
Definition: SHA1.h:39
MQTTClient_waitForCompletion
int MQTTClient_waitForCompletion(MQTTClient handle, MQTTClient_deliveryToken mdt, unsigned long timeout)
This function is called by the client application to synchronize execution of the main thread with co...
Definition: MQTTClient.c:2852
MQTTAsync_struct
Definition: MQTTAsyncUtils.h:89
MQTTAsync_init_options::do_openssl_init
int do_openssl_init
1 = we do openssl init, 0 = leave it to the application
Definition: MQTTAsync.h:238
MQTTPacket_VBIdecode
int MQTTPacket_VBIdecode(int(*getcharfn)(char *, int), unsigned int *value)
Decodes the message length according to the MQTT algorithm.
Definition: MQTTPacket.c:1032
MQTTResponse_free
void MQTTResponse_free(MQTTResponse response)
Frees the storage associated with the MQTT response.
Definition: MQTTClient.c:647
Publish::header
Header header
MQTT header byte.
Definition: MQTTPacket.h:199
MQTTAsync_connectOptions::automaticReconnect
int automaticReconnect
Reconnect automatically in the case of a connection being lost.
Definition: MQTTAsync.h:1329
Socket_abortWrite
int Socket_abortWrite(SOCKET socket)
Continue an outstanding write for a particular socket.
Definition: Socket.c:1317
Socket_noPendingWrites
int Socket_noPendingWrites(SOCKET socket)
Indicate whether any data is pending outbound for a socket.
Definition: Socket.c:674
MQTTAsync_responseOptions::onSuccess5
MQTTAsync_onSuccess5 * onSuccess5
A pointer to a callback function to be called if the API call successfully completes.
Definition: MQTTAsync.h:745
pstmkdir
int pstmkdir(char *pPathname)
Function to create a directory.
Definition: MQTTPersistenceDefault.c:165
MQTTPersistence_beforeWrite
int MQTTPersistence_beforeWrite(void *context, int bufcount, char *buffers[], int buflens[])
A callback which is invoked just before a write to persistence.
Definition: MQTTClientPersistence.h:264
MQTTAsync_message::struct_version
int struct_version
The version number of this structure.
Definition: MQTTAsync.h:277
writeInt4
void writeInt4(char **pptr, int anInt)
Writes an integer as 4 bytes to an output buffer.
Definition: MQTTPacket.c:945
ListFree
void ListFree(List *aList)
Removes and frees all items in a list, and frees the list itself.
Definition: LinkedList.c:381
MQTTPacket_send_puback
int MQTTPacket_send_puback(int MQTTVersion, int msgid, networkHandles *net, const char *clientID)
Send an MQTT PUBACK packet down a socket.
Definition: MQTTPacket.c:679
storageElement::file
char * file
the name of the source file where the storage was allocated
Definition: Heap.c:70
MQTTClient_setCommandTimeout
int MQTTClient_setCommandTimeout(MQTTClient handle, unsigned long milliSeconds)
Sets the timeout value for un/subscribe commands when waiting for the un/suback response from the ser...
Definition: MQTTClient.c:2947
Persistence_containskey
int(* Persistence_containskey)(void *handle, char *key)
Returns whether any data has been persisted using the specified key.
Definition: MQTTClientPersistence.h:208
MQTTAsync_willOptions::len
int len
binary payload length
Definition: MQTTAsync.h:1044
MQTTClient_connectOptions::connectTimeout
int connectTimeout
The time interval in seconds to allow a connect to complete.
Definition: MQTTClient.h:902
MQTTPacket_send_pingreq
int MQTTPacket_send_pingreq(networkHandles *net, const char *clientID)
Send an MQTT PINGREQ packet down a socket.
Definition: MQTTPacketOut.c:201
Thread_start
void Thread_start(thread_fn fn, void *parameter)
Start a new thread.
Definition: Thread.c:59
MQTTAsync_successData5::unsub
struct MQTTAsync_successData5::@4::@8 unsub
For unsubscribeMany, the list of reasonCodes returned by the server.
MQTTAsync_connectOptions::minRetryInterval
int minRetryInterval
The minimum automatic reconnect retry interval in seconds.
Definition: MQTTAsync.h:1333
clientSockCompare
static int clientSockCompare(void *a, void *b)
List callback function for comparing clients by socket.
Definition: MQTTClient.c:687
MQTTPersistence_restorePacket
void * MQTTPersistence_restorePacket(int MQTTVersion, char *buffer, size_t buflen)
Returns a MQTT packet restored from persisted data.
Definition: MQTTPersistence.c:363
MQTTClient_SSLOptions::ssl_psk_context
void * ssl_psk_context
Application-specific contex for ssl_psk_cb Exists only if struct_version >= 4.
Definition: MQTTClient.h:757
MQTTProtocol_removePublication
void MQTTProtocol_removePublication(Publications *p)
Remove stored message data.
Definition: MQTTProtocolClient.c:295
Sockets::write_pending
List * write_pending
list of sockets for which a write is pending
Definition: Socket.h:115
HeapDumpString
int HeapDumpString(FILE *file, char *str)
Dump a string from the heap so that it can be displayed conveniently.
Definition: Heap.c:443
MQTTPacket_publish
void * MQTTPacket_publish(int MQTTVersion, unsigned char aHeader, char *data, size_t datalen)
Function used in the new packets table to create publish packets.
Definition: MQTTPacket.c:556
MQTTClient_connectOptions::len
int len
binary password length
Definition: MQTTClient.h:956
ListElementStruct::next
struct ListElementStruct * next
pointer to next list element
Definition: LinkedList.h:75
Connect::username
bool username
3.1 user name
Definition: MQTTPacket.h:115
bytes
struct @34::@35 bytes[4]
up to 4 bytes can be used per character
MQTTAsync_message::payloadlen
int payloadlen
The length of the MQTT message payload in bytes.
Definition: MQTTAsync.h:279
MQTTAsync_init_options::struct_version
int struct_version
The version number of this structure.
Definition: MQTTAsync.h:236
MQTTPacket_send_disconnect
int MQTTPacket_send_disconnect(Clients *client, enum MQTTReasonCodes reason, MQTTProperties *props)
Send an MQTT disconnect packet down a socket.
Definition: MQTTPacket.c:511
MQTTProtocol_assignMsgId
int MQTTProtocol_assignMsgId(Clients *client)
Assign a new message id for a client.
Definition: MQTTProtocolClient.c:86
MQTTAsync_successData5::sessionPresent
int sessionPresent
the session present flag returned from the server
Definition: MQTTAsync.h:629
Socket_new
int Socket_new(const char *addr, size_t addr_len, int port, SOCKET *sock)
Create a new socket and TCP connect to an address/port.
Definition: Socket.c:1025
MQTTProperty::data
MQTTLenString data
The value of a string property, or the name of a user property.
Definition: MQTTProperties.h:103
MQTTAsync_successData::sessionPresent
int sessionPresent
the session present flag returned from the server
Definition: MQTTAsync.h:594
MQTTAsync_successData5::token
MQTTAsync_token token
A token identifying the successful request.
Definition: MQTTAsync.h:606
myrealloc
void * myrealloc(char *file, int line, void *p, size_t size)
Reallocates a block of memory.
Definition: Heap.c:320
MQTTAsync_willOptions::payload
struct MQTTAsync_willOptions::@9 payload
The LWT payload in binary form.
ListElementStruct::content
void * content
pointer to element content
Definition: LinkedList.h:76
MQTTAsync_willOptions::struct_version
int struct_version
The version number of this structure.
Definition: MQTTAsync.h:1027
MQTTPersistence_restorePackets
int MQTTPersistence_restorePackets(Clients *c)
Restores the persisted records to the outbound and inbound message queues of the client.
Definition: MQTTPersistence.c:185
MQTTAsync_successData5::serverURI
char * serverURI
the connection string of the server
Definition: MQTTAsync.h:627
myfree
void myfree(char *file, int line, void *p)
Frees a block of memory.
Definition: Heap.c:277
MQTTAsync_connectOptions::struct_version
int struct_version
The version number of this structure.
Definition: MQTTAsync.h:1212
MQTTPacket_decode
int MQTTPacket_decode(networkHandles *net, size_t *value)
Decodes the message length according to the MQTT algorithm.
Definition: MQTTPacket.c:328
PacketBuffers::buflens
size_t * buflens
array of byte buffers
Definition: Socket.h:103
Clients::clientID
char * clientID
the string id of the client
Definition: Clients.h:120
MQTTSubscribe_options
The MQTT V5 subscribe options, apart from QoS which existed before V5.
Definition: MQTTSubscribeOpts.h:21
Connack::MQTTVersion
unsigned int MQTTVersion
the version of MQTT
Definition: MQTTPacket.h:154
MQTTProtocol
Definition: MQTTProtocol.h:35
MQTTAsync_failureData5::token
MQTTAsync_token token
A token identifying the failed request.
Definition: MQTTAsync.h:554
NodeStruct::parent
struct NodeStruct * parent
pointer to parent tree node, in case we need it
Definition: Tree.h:79
Messages
Client publication message data.
Definition: Clients.h:54
MQTTClient_createOptions::struct_version
int struct_version
The version number of this structure.
Definition: MQTTClient.h:553
intcompare
int intcompare(void *a, void *b)
List callback function for comparing integers.
Definition: LinkedList.c:436
Connect::willQoS
unsigned int willQoS
will QoS value
Definition: MQTTPacket.h:112
Heap_findItem
void * Heap_findItem(void *p)
Utility to find an item in the heap.
Definition: Heap.c:368
MQTTProtocol_handleSubacks
int MQTTProtocol_handleSubacks(void *pack, SOCKET sock)
Process an incoming suback packet for a socket.
Definition: MQTTProtocolOut.c:406
MQTTAsync_successData::qosList
int * qosList
For subscribeMany, if more than one subscription was requested, the list of granted QoSs of the subsc...
Definition: MQTTAsync.h:582
Persistence_remove
int(* Persistence_remove)(void *handle, char *key)
Remove the data for the specified key from the store.
Definition: MQTTClientPersistence.h:169