List * inboundMsgs
inbound in flight messages
Definition: Clients.h:138
int maxInflightMessages
the max number of inflight outbound messages we allow
Definition: Clients.h:136
Header header
MQTT header byte.
Definition: MQTTPacket.h:186
-MQTTAsync_onSuccess * onSuccess
A pointer to a callback function to be called if the disconnect successfully completes.
Definition: MQTTAsync.h:1417
+MQTTAsync_onSuccess * onSuccess
A pointer to a callback function to be called if the disconnect successfully completes.
Definition: MQTTAsync.h:1443
int MQTTPersistence_afterRead(void *context, char **buffer, int *buflen)
A callback which is invoked just after a read from persistence.
Definition: MQTTClientPersistence.h:275
-int verify
Whether to carry out post-connect checks, including that a certificate matches the given host name.
Definition: MQTTAsync.h:1108
+int verify
Whether to carry out post-connect checks, including that a certificate matches the given host name.
Definition: MQTTAsync.h:1122
int Socket_setnonblocking(SOCKET sock)
Set a socket non-blocking, OS independently.
Definition: Socket.c:82
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
-const char * message
The LWT payload.
Definition: MQTTAsync.h:1017
-int serverURIcount
The number of entries in the optional serverURIs array.
Definition: MQTTClient.h:901
+const char * message
The LWT payload.
Definition: MQTTAsync.h:1031
+int serverURIcount
The number of entries in the optional serverURIs array.
Definition: MQTTClient.h:919
bool will
will flag
Definition: MQTTPacket.h:111
Data for a suback packet.
Definition: MQTTPacket.h:171
-MQTTAsync_onSuccess5 * onSuccess5
A pointer to a callback function to be called if the connect successfully completes.
Definition: MQTTAsync.h:1343
+MQTTAsync_onSuccess5 * onSuccess5
A pointer to a callback function to be called if the connect successfully completes.
Definition: MQTTAsync.h:1362
size_t max_size
max size the heap has reached in bytes
Definition: Heap.h:65
void * TreeRemoveNodeIndex(Tree *aTree, Node *curnode, int index)
Remove an item from a tree.
Definition: Tree.c:420
-MQTTClient_willOptions * will
This is a pointer to an MQTTClient_willOptions structure.
Definition: MQTTClient.h:868
+MQTTClient_willOptions * will
This is a pointer to an MQTTClient_willOptions structure.
Definition: MQTTClient.h:886
int msgId
MQTT message id.
Definition: MQTTPacket.h:187
-Definition: MQTTClient.c:300
+Definition: MQTTClient.c:302
int clientIDCompare(void *a, void *b)
List callback function for comparing clients by clientid.
Definition: Clients.c:36
-static thread_return_type WINAPI connectionLost_call(void *context)
Wrapper function to call connection lost on a separate thread.
Definition: MQTTClient.c:683
-int qos
The quality of service (QoS) assigned to the message.
Definition: MQTTClient.h:291
-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:2692
+static thread_return_type WINAPI connectionLost_call(void *context)
Wrapper function to call connection lost on a separate thread.
Definition: MQTTClient.c:700
+int qos
The quality of service (QoS) assigned to the message.
Definition: MQTTClient.h:295
+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
unsigned int ping_due
we couldn't send a ping so we should send one when we can
Definition: Clients.h:129
char * SocketBuffer_getQueuedData(SOCKET socket, size_t bytes, size_t *actual_len)
Get any queued data for a specific socket.
Definition: SocketBuffer.c:176
-int packet_type
Packet type on which the failure occurred - used for publish QoS 1/2 exchanges.
Definition: MQTTAsync.h:559
+int packet_type
Packet type on which the failure occurred - used for publish QoS 1/2 exchanges.
Definition: MQTTAsync.h:564
void SocketBuffer_freeDefQ(void)
Free the default queue memory.
Definition: SocketBuffer.c:122
-Definition: MQTTAsyncUtils.h:40
+Definition: MQTTAsyncUtils.h:41
builds a websocket frame for data transmission
Definition: WebSocket.c:227
void SocketBuffer_terminate(void)
Terminate the socketBuffer module.
Definition: SocketBuffer.c:133
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
size_t size
size of content
Definition: Tree.h:82
-void * context
Definition: MQTTAsync.h:1429
-char struct_id[4]
The eyecatcher for this structure.
Definition: MQTTAsync.h:269
+void * context
Definition: MQTTAsync.h:1455
+char struct_id[4]
The eyecatcher for this structure.
Definition: MQTTAsync.h:274
int socketcompare(void *a, void *b)
List callback function for comparing socket_queues by socket.
Definition: SocketBuffer.c:70
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
-Definition: MQTTClient.c:335
+Definition: MQTTClient.c:337
char * topic
topic string
Definition: MQTTPacket.h:200
#define MQTTCLIENT_PERSISTENCE_ERROR
Application-specific persistence functions must return this error code if there is a problem executin...
Definition: MQTTClientPersistence.h:85
-void MQTTClient_setTraceCallback(MQTTClient_traceCallback *callback)
This function sets the trace callback if needed.
Definition: MQTTClient.c:2879
+void MQTTClient_setTraceCallback(MQTTClient_traceCallback *callback)
This function sets the trace callback if needed.
Definition: MQTTClient.c:2941
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
int MQTTProtocol_handleDisconnects(void *pack, SOCKET sock)
Process an incoming disconnect packet for a socket.
Definition: MQTTProtocolOut.c:465
Definition: MQTTProtocol.h:28
int ListRemoveHead(List *aList)
Removes and frees an the first item in a list.
Definition: LinkedList.c:294
-void * payload
A pointer to the payload of the MQTT message.
Definition: MQTTClient.h:277
-Definition: MQTTAsyncUtils.h:32
-int readInt4(char **pptr)
Calculates an integer from two bytes read from the input buffer.
Definition: MQTTPacket.c:962
+void * payload
A pointer to the payload of the MQTT message.
Definition: MQTTClient.h:281
+Definition: MQTTAsyncUtils.h:33
+int readInt4(char **pptr)
Calculates an integer from two bytes read from the input buffer.
Definition: MQTTPacket.c:965
MQTT version 5 property list.
Definition: MQTTProperties.h:112
-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:250
+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
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
struct MQTTAsync_successData::@1::@2 pub
For publish, the message being sent to the server.
#define MQTTCLIENT_PERSISTENCE_USER
This persistence_type value specifies an application-specific persistence mechanism (see MQTTClient_c...
Definition: MQTTClientPersistence.h:79
Information about the state of the heap.
Definition: Heap.h:62
int MQTTVersion
the version of MQTT
Definition: MQTTPacket.h:205
-int keepAliveInterval
The "keep alive" interval, measured in seconds, defines the maximum time that should pass without com...
Definition: MQTTClient.h:830
+int keepAliveInterval
The "keep alive" interval, measured in seconds, defines the maximum time that should pass without com...
Definition: MQTTClient.h:848
int(* Persistence_get)(void *handle, char *key, char **buffer, int *buflen)
Retrieve the specified data from the persistent store.
Definition: MQTTClientPersistence.h:156
int len
PUBREC, PUBREL, PUBCOMP
Definition: Clients.h:64
static int MQTTProtocol_startPublishCommon(Clients *pubclient, Publish *publish, int qos, int retained)
Utility function to start a new publish exchange.
Definition: MQTTProtocolClient.c:149
int SocketBuffer_getQueuedChar(SOCKET socket, char *c)
Get any queued character for a specific socket.
Definition: SocketBuffer.c:219
void * phandle
the persistence handle
Definition: Clients.h:145
MQTTClient_persistence * persistence
a persistence implementation
Definition: Clients.h:146
-char *const * serverURIs
An optional array of null-terminated strings specifying the servers to which the client will connect.
Definition: MQTTClient.h:915
-static void MQTTProtocol_checkPendingWrites(void)
See if any pending writes have been completed, and cleanup if so.
Definition: MQTTClient.c:2989
-int MQTTVersion
Whether the MQTT version is 3.1, 3.1.1, or 5.
Definition: MQTTAsync.h:967
+char *const * serverURIs
An optional array of null-terminated strings specifying the servers to which the client will connect.
Definition: MQTTClient.h:933
+static void MQTTProtocol_checkPendingWrites(void)
See if any pending writes have been completed, and cleanup if so.
Definition: MQTTClient.c:3051
+int MQTTVersion
Whether the MQTT version is 3.1, 3.1.1, or 5.
Definition: MQTTAsync.h:981
char * httpsProxy
HTTPS proxy.
Definition: Clients.h:155
-char * serverURI
the connection string of the server
Definition: MQTTAsync.h:587
-int qos
The quality of service setting for the LWT message (see MQTTClient_message.qos and qos).
Definition: MQTTClient.h:631
+char * serverURI
the connection string of the server
Definition: MQTTAsync.h:592
+int qos
The quality of service setting for the LWT message (see MQTTClient_message.qos and qos).
Definition: MQTTClient.h:643
networkHandles net
network info for this client
Definition: Clients.h:132
unsigned int reserved
message type nibble
Definition: MQTTPacket.h:149
int(* Persistence_close)(void *handle)
Close the persistent store referred to by the handle.
Definition: MQTTClientPersistence.h:123
Data for a packet with header only.
Definition: MQTTPacket.h:162
-int code
A numeric code identifying the MQTT client library error.
Definition: MQTTAsync.h:555
-void MQTTProtocol_freeMessageList(List *msgList)
Empty and free up all storage used by a message list.
Definition: MQTTProtocolClient.c:973
+int code
A numeric code identifying the MQTT client library error.
Definition: MQTTAsync.h:560
+void MQTTProtocol_freeMessageList(List *msgList)
Empty and free up all storage used by a message list.
Definition: MQTTProtocolClient.c:994
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
-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:852
-int MQTTVersion
Sets the version of MQTT to be used on the connect.
Definition: MQTTAsync.h:1306
+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
+int MQTTVersion
Sets the version of MQTT to be used on the connect.
Definition: MQTTAsync.h:1325
Data for an MQTT V5 unsuback packet.
Definition: MQTTPacket.h:184
-char struct_id[4]
The eyecatcher for this structure.
Definition: MQTTAsync.h:1404
-const char * privateKey
If not included in the sslKeyStore, this setting points to the file in PEM format containing the clie...
Definition: MQTTAsync.h:1079
-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:791
-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:1964
-int Socket_addSocket(SOCKET newSd)
Add a socket to the list of socket to check with select.
Definition: Socket.c:260
-A structure representing the payload and attributes of an MQTT message.
Definition: MQTTClient.h:267
-char * destinationName
the topic destination for the message
Definition: MQTTAsync.h:617
+char struct_id[4]
The eyecatcher for this structure.
Definition: MQTTAsync.h:1430
+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
+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
+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
+int Socket_addSocket(SOCKET newSd)
Add a socket to the list of socket to check with select.
Definition: Socket.c:266
+A structure representing the payload and attributes of an MQTT message.
Definition: MQTTClient.h:271
+char * destinationName
the topic destination for the message
Definition: MQTTAsync.h:622
int MQTTPersistence_initialize(Clients *c, const char *serverURI)
Open persistent store and restore any persisted messages.
Definition: MQTTPersistence.c:115
MQTTPersistence_afterRead * afterRead
persistence read callback
Definition: Clients.h:148
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
void Log(enum LOG_LEVELS log_level, int msgno, const char *format,...)
Log a message.
Definition: Log.c:425
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
-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:371
+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
void ListFreeNoContent(List *aList)
Removes and but does not free all items in a list, and frees the list itself.
Definition: LinkedList.c:392
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
void * content
pointer to element content
Definition: Tree.h:81
-const char * CApath
From the OpenSSL documentation: If CApath is not NULL, it points to a directory containing CA certifi...
Definition: MQTTClient.h:720
-int allowDisconnectedSendAtAnyTime
Allow sending of messages while disconnected before a first successful connect.
Definition: MQTTAsync.h:971
+const char * CApath
From the OpenSSL documentation: If CApath is not NULL, it points to a directory containing CA certifi...
Definition: MQTTClient.h:732
+int allowDisconnectedSendAtAnyTime
Allow sending of messages while disconnected before a first successful connect.
Definition: MQTTAsync.h:985
START_TIME_TYPE ping_due_time
the time at which the ping should have been sent (ping_due)
Definition: Clients.h:131
-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:2406
-MQTTClient_libraryInfo is used to store details relating to the currently used library such as the ve...
Definition: MQTTClient.h:779
+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_libraryInfo is used to store details relating to the currently used library such as the ve...
Definition: MQTTClient.h:791
enum MQTTPropertyCodes identifier
The MQTT V5 property id.
Definition: MQTTProperties.h:96
Header header
MQTT header byte.
Definition: MQTTPacket.h:91
-void MQTTPacket_freeUnsuback(Unsuback *pack)
Free allocated storage for a suback packet.
Definition: MQTTPacket.c:708
+void MQTTPacket_freeUnsuback(Unsuback *pack)
Free allocated storage for a suback packet.
Definition: MQTTPacket.c:711
#define MQTTCLIENT_PERSISTENCE_NONE
This persistence_type value specifies a memory-based persistence mechanism (see MQTTClient_create()).
Definition: MQTTClientPersistence.h:74
struct MQTTClient_connectOptions::@19 binarypwd
Optional binary password.
-char struct_id[4]
The eyecatcher for this structure.
Definition: MQTTAsync.h:706
+char struct_id[4]
The eyecatcher for this structure.
Definition: MQTTAsync.h:711
unsigned char rc
connack reason code
Definition: MQTTPacket.h:153
-const char * trustStore
The file in PEM format containing the public digital certificates trusted by the client.
Definition: MQTTAsync.h:1069
+const char * trustStore
The file in PEM format containing the public digital certificates trusted by the client.
Definition: MQTTAsync.h:1083
int line
the line no in the source file where it was allocated
Definition: Heap.c:71
ListElement * ListNextElement(List *aList, ListElement **pos)
Forward iteration through a list.
Definition: LinkedList.c:411
int MQTTVersion
the version of MQTT
Definition: MQTTPacket.h:175
unsigned char version
MQTT version number.
Definition: MQTTPacket.h:126
Definition: MQTTPersistence.h:84
-char struct_id[4]
The eyecatcher for this structure.
Definition: MQTTAsync.h:949
+char struct_id[4]
The eyecatcher for this structure.
Definition: MQTTAsync.h:963
Definition: StackTrace.c:46
int MQTTPersistence_create(MQTTClient_persistence **persistence, int type, void *pcontext)
Creates a MQTTClient_persistence structure representing a persistence implementation.
Definition: MQTTPersistence.c:51
MQTTLenString value
The value of a user property.
Definition: MQTTProperties.h:104
-int Thread_destroy_mutex(mutex_type mutex)
Destroy a mutex which has already been created.
Definition: Thread.c:155
-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:1035
+int Thread_destroy_mutex(mutex_type mutex)
Destroy a mutex which has already been created.
Definition: Thread.c:181
+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
MQTTProperties properties
MQTT 5.0 properties.
Definition: MQTTPacket.h:220
-void writeData(char **pptr, const void *data, int datalen)
Writes length delimited data to an output buffer.
Definition: MQTTPacket.c:479
-MQTTAsync_sslProperties defines the settings to establish an SSL/TLS connection using the OpenSSL lib...
Definition: MQTTAsync.h:1054
-const char * message
Optional further text explaining the error.
Definition: MQTTAsync.h:557
-char struct_id[4]
The eyecatcher for this structure.
Definition: MQTTAsync.h:1009
+void writeData(char **pptr, const void *data, int datalen)
Writes length delimited data to an output buffer.
Definition: MQTTPacket.c:482
+MQTTAsync_sslProperties defines the settings to establish an SSL/TLS connection using the OpenSSL lib...
Definition: MQTTAsync.h:1068
+const char * message
Optional further text explaining the error.
Definition: MQTTAsync.h:562
+char struct_id[4]
The eyecatcher for this structure.
Definition: MQTTAsync.h:1023
-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:2451
+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
bool sessionPresent
was a session found on the server?
Definition: MQTTPacket.h:148
char * willMsg
will payload
Definition: MQTTPacket.h:123
-cond_type Thread_create_cond(int *rc)
Create a new condition variable.
Definition: Thread.c:358
+cond_type Thread_create_cond(int *rc)
Create a new condition variable.
Definition: Thread.c:384
int connect_count
the number of outbound messages on reconnect - to ensure we send them all
Definition: Clients.h:140
void Heap_terminate(void)
Heap termination.
Definition: Heap.c:417
Definition: MQTTProtocolClient.c:61
-static thread_return_type WINAPI call_disconnected(void *context)
Wrapper function to call disconnected on a separate thread.
Definition: MQTTClient.c:721
-MQTTProperties properties
MQTT V5 properties returned, if any.
Definition: MQTTAsync.h:603
+struct pollfd * fds_read
poll read file descriptors
Definition: Socket.h:126
+static thread_return_type WINAPI call_disconnected(void *context)
Wrapper function to call disconnected on a separate thread.
Definition: MQTTClient.c:738
+MQTTProperties properties
MQTT V5 properties returned, if any.
Definition: MQTTAsync.h:608
int indexes
no of indexes into tree
Definition: Tree.h:83
-int struct_version
The version number of this structure.
Definition: MQTTAsync.h:599
-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:1865
+int struct_version
The version number of this structure.
Definition: MQTTAsync.h:604
+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
uint8_t mask[4]
array of flags indicating whether each buffer needs to be freed
Definition: Socket.h:105
int UTF8_validate(int len, const char *data)
Validate a length-delimited string has only UTF-8 characters.
Definition: utf-8.c:129
-MQTTAsync_onSuccess * onSuccess
A pointer to a callback function to be called if the connect successfully completes.
Definition: MQTTAsync.h:1271
+MQTTAsync_onSuccess * onSuccess
A pointer to a callback function to be called if the connect successfully completes.
Definition: MQTTAsync.h:1290
int msgId
MQTT message id.
Definition: MQTTPacket.h:217
-void MQTTClient_yield(void)
When implementing a single-threaded client, call this function periodically to allow processing of me...
Definition: MQTTClient.c:2748
-The connect options that can be updated before an automatic reconnect.
Definition: MQTTAsync.h:460
-int serverURIcount
The number of entries in the serverURIs array.
Definition: MQTTAsync.h:1287
-int retained
The retained flag for the LWT message (see MQTTClient_message.retained).
Definition: MQTTClient.h:626
-Options for the ::MQTTAsync_createWithOptions call.
Definition: MQTTAsync.h:946
+void MQTTClient_yield(void)
When implementing a single-threaded client, call this function periodically to allow processing of me...
Definition: MQTTClient.c:2810
+The connect options that can be updated before an automatic reconnect.
Definition: MQTTAsync.h:465
+int serverURIcount
The number of entries in the serverURIs array.
Definition: MQTTAsync.h:1306
+int retained
The retained flag for the LWT message (see MQTTClient_message.retained).
Definition: MQTTClient.h:638
+Options for the ::MQTTAsync_createWithOptions call.
Definition: MQTTAsync.h:960
void Socket_outInitialize(void)
Initialize the socket module.
Definition: Socket.c:130
unsigned int integer4
holds the value of a 4 byte integer property type
Definition: MQTTProperties.h:101
int keepAliveTimer
keepalive timeout value in seconds
Definition: MQTTPacket.h:125
-int Thread_wait_cond(cond_type condvar, int timeout_ms)
Wait with a timeout (ms) for condition variable.
Definition: Thread.c:409
-const char * topicName
The LWT topic to which the LWT message will be published.
Definition: MQTTAsync.h:1015
-void MQTTPacket_freeSuback(Suback *pack)
Free allocated storage for a suback packet.
Definition: MQTTPacket.c:692
-thread_id_type Thread_getid(void)
Get the thread id of the thread from which this function is called.
Definition: Thread.c:175
+int Thread_wait_cond(cond_type condvar, int timeout_ms)
Wait with a timeout (ms) for condition variable.
Definition: Thread.c:435
+const char * topicName
The LWT topic to which the LWT message will be published.
Definition: MQTTAsync.h:1029
+void MQTTPacket_freeSuback(Suback *pack)
Free allocated storage for a suback packet.
Definition: MQTTPacket.c:695
+thread_id_type Thread_getid(void)
Get the thread id of the thread from which this function is called.
Definition: Thread.c:201
Stored publication data to minimize copying.
Definition: Clients.h:41
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 defines the MQTT "Last Will and Testament" (LWT) settings for the client.
Definition: MQTTClient.h:611
-const char * keyStore
The file in PEM format containing the public certificate chain of the client.
Definition: MQTTAsync.h:1074
-char struct_id[4]
The eyecatcher for this structure.
Definition: MQTTClient.h:662
-enum MQTTReasonCodes * reasonCodes
an array of reasonCodes
Definition: MQTTAsync.h:611
-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:2137
-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:285
-void * context
Definition: MQTTAsync.h:1283
+MQTTClient_willOptions defines the MQTT "Last Will and Testament" (LWT) settings for the client.
Definition: MQTTClient.h:623
+const char * keyStore
The file in PEM format containing the public certificate chain of the client.
Definition: MQTTAsync.h:1088
+char struct_id[4]
The eyecatcher for this structure.
Definition: MQTTClient.h:674
+enum MQTTReasonCodes * reasonCodes
an array of reasonCodes
Definition: MQTTAsync.h:616
+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
+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
+void * context
Definition: MQTTAsync.h:1302
Data for a publish packet.
Definition: MQTTPacket.h:197
-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:2420
+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
size_t size
heap storage used
Definition: Tree.h:85
-Structure to define call options.
Definition: MQTTAsync.h:703
+Structure to define call options.
Definition: MQTTAsync.h:708
int clientSocketCompare(void *a, void *b)
List callback function for comparing clients by socket.
Definition: Clients.c:50
-MQTTClient_connectOptions defines several settings that control the way the client connects to an MQT...
Definition: MQTTClient.h:806
-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:2123
+MQTTClient_connectOptions defines several settings that control the way the client connects to an MQT...
Definition: MQTTClient.h:824
+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
Messages * MQTTProtocol_createMessage(Publish *publish, Messages **mm, int qos, int retained, int allocatePayload)
Copy and store message data for retries.
Definition: MQTTProtocolClient.c:206
int MQTTProtocol_handlePingresps(void *pack, SOCKET sock)
Process an incoming pingresp packet for a socket.
Definition: MQTTProtocolOut.c:365
-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:1949
-MQTTAsync_SSLOptions * ssl
This is a pointer to an MQTTAsync_SSLOptions structure.
Definition: MQTTAsync.h:1265
-const char * message
Optional text explaining the error.
Definition: MQTTAsync.h:537
+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_SSLOptions * ssl
This is a pointer to an MQTTAsync_SSLOptions structure.
Definition: MQTTAsync.h:1284
+const char * message
Optional text explaining the error.
Definition: MQTTAsync.h:542
static List * queues
List of queued input buffers.
Definition: SocketBuffer.c:50
Definition: SocketBuffer.h:44
-void MQTTProtocol_closeSession(Clients *c, int sendwill)
mqttclient_mutex must be locked when you call this function, if multi threaded
Definition: MQTTClient.c:1921
+void MQTTProtocol_closeSession(Clients *c, int sendwill)
mqttclient_mutex must be locked when you call this function, if multi threaded
Definition: MQTTClient.c:1965
int sessionExpiry
MQTT 5 session expiry.
Definition: Clients.h:153
-int sendWhileDisconnected
Whether to allow messages to be sent when the client library is not connected.
Definition: MQTTAsync.h:957
-int MQTTVersion
the version of MQTT being used
Definition: MQTTAsync.h:588
+int sendWhileDisconnected
Whether to allow messages to be sent when the client library is not connected.
Definition: MQTTAsync.h:971
+int MQTTVersion
the version of MQTT being used
Definition: MQTTAsync.h:593
static List writes
List of queued write buffers.
Definition: SocketBuffer.c:55
-void MQTTClient_free(void *memory)
This function frees memory allocated by the MQTT C client library, especially the topic name.
Definition: MQTTClient.c:622
+void MQTTClient_free(void *memory)
This function frees memory allocated by the MQTT C client library, especially the topic name.
Definition: MQTTClient.c:639
Definition: MQTTPersistence.h:71
void MQTTPacket_freeConnack(Connack *pack)
Free allocated storage for a connack packet.
Definition: MQTTPacketOut.c:185
static void HeapScan(enum LOG_LEVELS log_level)
Scans the heap and reports any items currently allocated.
Definition: Heap.c:383
Tree * TreeInitialize(int(*compare)(void *, void *, int))
Allocates and initializes a new tree structure.
Definition: Tree.c:65
-MQTTProperties * connectProperties
MQTT V5 properties for connect.
Definition: MQTTAsync.h:1333
+MQTTProperties * connectProperties
MQTT V5 properties for connect.
Definition: MQTTAsync.h:1352
struct @34 valid_ranges[]
Structure to hold the valid ranges of UTF-8 characters, for each byte up to 4.
-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:739
-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:2873
+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
+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
unsigned int allow_duplicates
switch to allow duplicate entries
Definition: Tree.h:87
-int cleansession
This is a boolean value.
Definition: MQTTAsync.h:1226
+int cleansession
This is a boolean value.
Definition: MQTTAsync.h:1245
Persistence_put pput
A function pointer to an implementation of Persistence_put().
Definition: MQTTClientPersistence.h:231
-enum MQTTReasonCodes reasonCode
The MQTT reason code returned.
Definition: MQTTAsync.h:551
+enum MQTTReasonCodes reasonCode
The MQTT reason code returned.
Definition: MQTTAsync.h:556
void * TreeRemoveIndex(Tree *aTree, void *content, int index)
Remove an item from a tree.
Definition: Tree.c:487
-int verify
Whether to carry out post-connect checks, including that a certificate matches the given host name.
Definition: MQTTClient.h:713
-MQTTClient_SSLOptions * ssl
This is a pointer to an MQTTClient_SSLOptions structure.
Definition: MQTTClient.h:897
+int verify
Whether to carry out post-connect checks, including that a certificate matches the given host name.
Definition: MQTTClient.h:725
+MQTTClient_SSLOptions * ssl
This is a pointer to an MQTTClient_SSLOptions structure.
Definition: MQTTClient.h:915
int MQTTPersistence_remove(Clients *c, char *type, int qos, int msgId)
Deletes a record from the persistent store.
Definition: MQTTPersistence.c:533
unsigned int nfds
no of file descriptors for poll
Definition: Socket.h:125
int max_trace_entries
max no of entries in the trace buffer
Definition: Log.h:66
-int len
binary payload length
Definition: MQTTClient.h:635
+int len
binary payload length
Definition: MQTTClient.h:647
char lower
lower limit of valid range
Definition: utf-8.c:49
int count
no of items
Definition: LinkedList.h:72
-A structure representing the payload and attributes of an MQTT message.
Definition: MQTTAsync.h:266
+A structure representing the payload and attributes of an MQTT message.
Definition: MQTTAsync.h:271
Definition: SocketBuffer.h:33
-int dup
The dup flag indicates whether or not this message is a duplicate.
Definition: MQTTClient.h:317
-MQTTAsync_onFailure5 * onFailure5
A pointer to a callback function to be called if the disconnect fails.
Definition: MQTTAsync.h:1449
-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:1121
-MQTTAsync_token token
A token identifying the successful request.
Definition: MQTTAsync.h:568
-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:1134
-int Thread_signal_cond(cond_type condvar)
Signal a condition variable.
Definition: Thread.c:392
-Initialization options.
Definition: MQTTClient.h:225
+int dup
The dup flag indicates whether or not this message is a duplicate.
Definition: MQTTClient.h:321
+MQTTAsync_onFailure5 * onFailure5
A pointer to a callback function to be called if the disconnect fails.
Definition: MQTTAsync.h:1475
+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_token token
A token identifying the successful request.
Definition: MQTTAsync.h:573
+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
+int Thread_signal_cond(cond_type condvar)
Signal a condition variable.
Definition: Thread.c:418
+Initialization options.
Definition: MQTTClient.h:229
Header header
MQTT header byte.
Definition: MQTTPacket.h:135
int stringcompare(void *a, void *b)
List callback function for comparing C strings.
Definition: LinkedList.c:448
-const char * password
MQTT servers that support the MQTT v3.1 protocol provide authentication and authorisation by user nam...
Definition: MQTTAsync.h:1248
-int len
binary password length
Definition: MQTTAsync.h:479
+const char * password
MQTT servers that support the MQTT v3.1 protocol provide authentication and authorisation by user nam...
Definition: MQTTAsync.h:1267
+int len
binary password length
Definition: MQTTAsync.h:484
static int ptrCompare(void *a, void *b, int value)
List callback function for comparing storage elements.
Definition: Heap.c:114
List * reasonCodes
list of reason codes
Definition: MQTTPacket.h:190
union Connect::@21 flags
connect flags byte
struct MQTTClient_connectOptions::@18 returned
Returned from the connect when the MQTT version used to connect is 3.1.1.
-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:733
-int code
A numeric code identifying the error.
Definition: MQTTAsync.h:535
-MQTTAsync_onSuccess * onSuccess
A pointer to a callback function to be called if the API call successfully completes.
Definition: MQTTAsync.h:715
-const char * topicName
The LWT topic to which the LWT message will be published.
Definition: MQTTClient.h:620
-int qos
For subscribe, the granted QoS of the subscription returned by the server.
Definition: MQTTAsync.h:574
+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
+int code
A numeric code identifying the error.
Definition: MQTTAsync.h:540
+MQTTAsync_onSuccess * onSuccess
A pointer to a callback function to be called if the API call successfully completes.
Definition: MQTTAsync.h:720
+const char * topicName
The LWT topic to which the LWT message will be published.
Definition: MQTTClient.h:632
+int qos
For subscribe, the granted QoS of the subscription returned by the server.
Definition: MQTTAsync.h:579
heap_info * Heap_get_info(void)
Access to heap state.
Definition: Heap.c:432
-char * Socket_getpeer(SOCKET sock)
Get information about the other end connected to a socket.
Definition: Socket.c:1399
-int qos
The quality of service setting for the LWT message (see MQTTAsync_message.qos and qos).
Definition: MQTTAsync.h:1026
-const char * trustStore
The file in PEM format containing the public digital certificates trusted by the client.
Definition: MQTTClient.h:674
+char * Socket_getpeer(SOCKET sock)
Get information about the other end connected to a socket.
Definition: Socket.c:1469
+int qos
The quality of service setting for the LWT message (see MQTTAsync_message.qos and qos).
Definition: MQTTAsync.h:1040
+const char * trustStore
The file in PEM format containing the public digital certificates trusted by the client.
Definition: MQTTClient.h:686
bool willRetain
will retain setting
Definition: MQTTPacket.h:113
-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:2109
-const char * keyStore
The file in PEM format containing the public certificate chain of the client.
Definition: MQTTClient.h:679
+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
+const char * keyStore
The file in PEM format containing the public certificate chain of the client.
Definition: MQTTClient.h:691
int MQTTVersion
the version of MQTT
Definition: MQTTPacket.h:219
-int reliable
This is a boolean value that controls how many messages can be in-flight simultaneously.
Definition: MQTTClient.h:862
+int reliable
This is a boolean value that controls how many messages can be in-flight simultaneously.
Definition: MQTTClient.h:880
#define MQTTCLIENT_PERSISTENCE_DEFAULT
This persistence_type value specifies the default file system-based persistence mechanism (see MQTTCl...
Definition: MQTTClientPersistence.h:69
-int cleansession
This is a boolean value.
Definition: MQTTClient.h:852
-const void * data
binary password data
Definition: MQTTAsync.h:480
+int cleansession
This is a boolean value.
Definition: MQTTClient.h:870
+const void * data
binary password data
Definition: MQTTAsync.h:485
enum LOG_LEVELS trace_level
trace level
Definition: Log.h:65
List * connect_pending
list of sockets for which a connect is pending
Definition: Socket.h:114
-void * ssl_error_context
Application-specific contex for OpenSSL error handler ERR_print_errors_cb Exists only if struct_versi...
Definition: MQTTAsync.h:1127
+void * ssl_error_context
Application-specific contex for OpenSSL error handler ERR_print_errors_cb Exists only if struct_versi...
Definition: MQTTAsync.h:1141
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
int(* Persistence_keys)(void *handle, char ***keys, int *nkeys)
Returns the keys in this persistent data store.
Definition: MQTTClientPersistence.h:186
-int dup
The dup flag indicates whether or not this message is a duplicate.
Definition: MQTTAsync.h:316
-MQTTAsync_onFailure * onFailure
A pointer to a callback function to be called if the disconnect fails.
Definition: MQTTAsync.h:1423
-char struct_id[4]
The eyecatcher for this structure.
Definition: MQTTAsync.h:1182
+int dup
The dup flag indicates whether or not this message is a duplicate.
Definition: MQTTAsync.h:321
+MQTTAsync_onFailure * onFailure
A pointer to a callback function to be called if the disconnect fails.
Definition: MQTTAsync.h:1449
+char struct_id[4]
The eyecatcher for this structure.
Definition: MQTTAsync.h:1201
Structure to hold all data for one list element.
Definition: LinkedList.h:56
Header header
MQTT header byte.
Definition: MQTTPacket.h:164
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
-int cur_fd
index into the fds_saved array
Definition: Socket.h:129
+int cur_fd
index into the fds_saved array
Definition: Socket.h:130
struct NodeStruct * child[2]
pointers to child tree nodes 0 = left, 1 = right
Definition: Tree.h:80
bool cleanstart
cleansession flag
Definition: MQTTPacket.h:110
Configuration data related to all clients.
Definition: Clients.h:168
-int enableServerCertAuth
True/False option to enable verification of the server certificate.
Definition: MQTTAsync.h:1095
+int enableServerCertAuth
True/False option to enable verification of the server certificate.
Definition: MQTTAsync.h:1109
size_t size
size of the allocated storage
Definition: Heap.c:73
-char * readUTF(char **pptr, char *enddata)
Reads a "UTF" string from the input buffer.
Definition: MQTTPacket.c:413
-char * Socket_getaddrname(struct sockaddr *sa, SOCKET sock)
Convert a numeric address to character string.
Definition: Socket.c:1361
-void MQTTClient_destroy(MQTTClient *handle)
This function frees the memory allocated to an MQTT client (see MQTTClient_create()).
Definition: MQTTClient.c:566
-void * payload
A pointer to the payload of the MQTT message.
Definition: MQTTAsync.h:276
-int enableServerCertAuth
True/False option to enable verification of the server certificate.
Definition: MQTTClient.h:700
+char * readUTF(char **pptr, char *enddata)
Reads a "UTF" string from the input buffer.
Definition: MQTTPacket.c:416
+char * Socket_getaddrname(struct sockaddr *sa, SOCKET sock)
Convert a numeric address to character string.
Definition: Socket.c:1431
+void MQTTClient_destroy(MQTTClient *handle)
This function frees the memory allocated to an MQTT client (see MQTTClient_create()).
Definition: MQTTClient.c:583
+void * payload
A pointer to the payload of the MQTT message.
Definition: MQTTAsync.h:281
+int enableServerCertAuth
True/False option to enable verification of the server certificate.
Definition: MQTTClient.h:712
unsigned int good
if we have an error on the socket we turn this off
Definition: Clients.h:127
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
-int retained
The retained flag for the LWT message (see MQTTAsync_message.retained).
Definition: MQTTAsync.h:1021
+int retained
The retained flag for the LWT message (see MQTTAsync_message.retained).
Definition: MQTTAsync.h:1035
The data for a length delimited string.
Definition: MQTTProperties.h:84
Persistence_close pclose
A function pointer to an implementation of Persistence_close().
Definition: MQTTClientPersistence.h:227
-int connectTimeout
The time interval in seconds to allow a connect to complete.
Definition: MQTTAsync.h:1252
+int connectTimeout
The time interval in seconds to allow a connect to complete.
Definition: MQTTAsync.h:1271
char nextMessageType
used for retry and expiry
Definition: Clients.h:63
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
-int Socket_continueWrite(SOCKET socket)
Continue an outstanding write for a particular socket.
Definition: Socket.c:1165
-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:2094
-int struct_version
The version number of this structure.
Definition: MQTTClient.h:820
-const MQTTAsync_nameValue * httpHeaders
HTTP headers for websockets.
Definition: MQTTAsync.h:1353
+int Socket_continueWrite(SOCKET socket)
Continue an outstanding write for a particular socket.
Definition: Socket.c:1232
+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
+int struct_version
The version number of this structure.
Definition: MQTTClient.h:838
+const MQTTAsync_nameValue * httpHeaders
HTTP headers for websockets.
Definition: MQTTAsync.h:1372
void ListZero(List *newl)
Sets a list structure to empty - all null values.
Definition: LinkedList.c:42
int Socket_error(char *aString, SOCKET sock)
Gets the specific error corresponding to SOCKET_ERROR.
Definition: Socket.c:109
-int Socket_continueWrites(SOCKET *socket, mutex_type mutex)
Continue any outstanding socket writes.
Definition: Socket.c:1296
-void MQTTPacket_freeAck(Ack *pack)
Free allocated storage for an ack packet.
Definition: MQTTPacket.c:625
+int Socket_continueWrites(SOCKET *socket, mutex_type mutex)
Continue any outstanding socket writes.
Definition: Socket.c:1363
+void MQTTPacket_freeAck(Ack *pack)
Free allocated storage for an ack packet.
Definition: MQTTPacket.c:628
char fixed_header[5]
header plus up to 4 length bytes
Definition: SocketBuffer.h:38
-The data returned on completion of an unsuccessful API call in the response callback onFailure.
Definition: MQTTAsync.h:542
-const char * httpsProxy
HTTPS proxy.
Definition: MQTTClient.h:960
+The data returned on completion of an unsuccessful API call in the response callback onFailure.
Definition: MQTTAsync.h:547
+const char * httpsProxy
HTTPS proxy.
Definition: MQTTClient.h:978
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
-const void * data
binary password data
Definition: MQTTClient.h:939
-MQTTAsync_onFailure * onFailure
A pointer to a callback function to be called if the API call fails.
Definition: MQTTAsync.h:721
-int maxBufferedMessages
The maximum number of messages allowed to be buffered.
Definition: MQTTAsync.h:961
-const char * serverURI
the serverURI connected to
Definition: MQTTClient.h:929
+const void * data
binary password data
Definition: MQTTClient.h:957
+MQTTAsync_onFailure * onFailure
A pointer to a callback function to be called if the API call fails.
Definition: MQTTAsync.h:726
+int maxBufferedMessages
The maximum number of messages allowed to be buffered.
Definition: MQTTAsync.h:975
+const char * serverURI
the serverURI connected to
Definition: MQTTClient.h:947
static int lines_written
number of lines written to the current output file
Definition: Log.c:106
-MQTTAsync_willOptions * will
This is a pointer to an MQTTAsync_willOptions structure.
Definition: MQTTAsync.h:1236
-void MQTTProtocol_keepalive(START_TIME_TYPE now)
MQTT protocol keepAlive processing.
Definition: MQTTProtocolClient.c:685
+MQTTAsync_willOptions * will
This is a pointer to an MQTTAsync_willOptions structure.
Definition: MQTTAsync.h:1255
+void MQTTProtocol_keepalive(START_TIME_TYPE now)
MQTT protocol keepAlive processing.
Definition: MQTTProtocolClient.c:700
+int MQTTProtocol_handlePubrecs(void *pack, SOCKET sock, Publications **pubToRemove)
Process an incoming pubrec packet for a socket.
Definition: MQTTProtocolClient.c:485
int count
no of items
Definition: Tree.h:84
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
-int msgid
The message identifier is normally reserved for internal use by the MQTT client and server.
Definition: MQTTClient.h:321
-int MQTTVersion
Sets the version of MQTT to be used on the connect.
Definition: MQTTClient.h:923
-int disableDefaultTrustStore
Don't load default SSL CA.
Definition: MQTTClient.h:752
-MQTTAsync_message message
the message being sent to the server
Definition: MQTTAsync.h:581
-int retained
The retained flag serves two purposes depending on whether the message it is associated with is being...
Definition: MQTTAsync.h:309
-int MQTTClient_setDisconnected(MQTTClient handle, void *context, MQTTClient_disconnected *disconnected)
Sets the MQTTClient_disconnected() callback function for a client.
Definition: MQTTClient.c:692
+int msgid
The message identifier is normally reserved for internal use by the MQTT client and server.
Definition: MQTTClient.h:325
+int MQTTVersion
Sets the version of MQTT to be used on the connect.
Definition: MQTTClient.h:941
+int disableDefaultTrustStore
Don't load default SSL CA.
Definition: MQTTClient.h:764
+MQTTAsync_message message
the message being sent to the server
Definition: MQTTAsync.h:586
+int retained
The retained flag serves two purposes depending on whether the message it is associated with is being...
Definition: MQTTAsync.h:314
+int MQTTClient_setDisconnected(MQTTClient handle, void *context, MQTTClient_disconnected *disconnected)
Sets the MQTTClient_disconnected() callback function for a client.
Definition: MQTTClient.c:709
union MQTTAsync_successData5::@4 alt
A union of the different values that can be returned for subscribe, unsubscribe and publish.
unsigned char retainAsPublished
To keep the retain flag as on the original publish message, set to 1.
Definition: MQTTSubscribeOpts.h:50
size_t len
length of frame
Definition: WebSocket.c:146
unsigned char rc
MQTT 5 reason code.
Definition: MQTTPacket.h:218
-int struct_version
The version number of this structure.
Definition: MQTTAsync.h:709
+int struct_version
The version number of this structure.
Definition: MQTTAsync.h:714
Data for a connack packet.
Definition: MQTTPacket.h:133
-int Thread_destroy_sem(sem_type sem)
Destroy a semaphore which has already been created.
Definition: Thread.c:334
-void MQTTProtocol_retry(START_TIME_TYPE now, int doRetry, int regardless)
MQTT retry protocol and socket pending writes processing.
Definition: MQTTProtocolClient.c:861
-int MQTTVersion
Whether the MQTT version is 3.1, 3.1.1, or 5.
Definition: MQTTClient.h:547
+int Thread_destroy_sem(sem_type sem)
Destroy a semaphore which has already been created.
Definition: Thread.c:360
+void MQTTProtocol_retry(START_TIME_TYPE now, int doRetry, int regardless)
MQTT retry protocol and socket pending writes processing.
Definition: MQTTProtocolClient.c:877
+int MQTTVersion
Whether the MQTT version is 3.1, 3.1.1, or 5.
Definition: MQTTClient.h:559
void * context
calling context - used when calling disconnect_internal
Definition: Clients.h:151
-int MQTTClient_disconnect(MQTTClient handle, int timeout)
This function attempts to disconnect the client from the MQTT server.
Definition: MQTTClient.c:1927
+int MQTTClient_disconnect(MQTTClient handle, int timeout)
This function attempts to disconnect the client from the MQTT server.
Definition: MQTTClient.c:1971
void SocketBuffer_cleanup(SOCKET socket)
Cleanup any buffers for a specific socket.
Definition: SocketBuffer.c:151
int MQTTVersion
the version of MQTT being used, 3, 4 or 5
Definition: Clients.h:152
Structure to hold all socket data for the module.
Definition: Socket.h:112
unsigned int heap_tracking
switch on heap tracking for this tree?
Definition: Tree.h:86
-int len
binary password length
Definition: MQTTAsync.h:1323
-const char * privateKey
If not included in the sslKeyStore, this setting points to the file in PEM format containing the clie...
Definition: MQTTClient.h:684
-const char * enabledCipherSuites
The list of cipher suites that the client will present to the server during the SSL handshake.
Definition: MQTTClient.h:697
-void writeChar(char **pptr, char c)
Writes one character to an output buffer.
Definition: MQTTPacket.c:438
+int len
binary password length
Definition: MQTTAsync.h:1342
+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
+const char * enabledCipherSuites
The list of cipher suites that the client will present to the server during the SSL handshake.
Definition: MQTTClient.h:709
+void writeChar(char **pptr, char c)
Writes one character to an output buffer.
Definition: MQTTPacket.c:441
int len
the length of the string
Definition: MQTTProperties.h:86
-const char * privateKeyPassword
The password to load the client's privateKey if encrypted.
Definition: MQTTAsync.h:1082
-static void MQTTProtocol_retries(START_TIME_TYPE now, Clients *client, int regardless)
MQTT retry processing per client.
Definition: MQTTProtocolClient.c:751
-int struct_version
The version number of this structure.
Definition: MQTTAsync.h:1406
+const char * privateKeyPassword
The password to load the client's privateKey if encrypted.
Definition: MQTTAsync.h:1096
+static void MQTTProtocol_retries(START_TIME_TYPE now, Clients *client, int regardless)
MQTT retry processing per client.
Definition: MQTTProtocolClient.c:767
+int struct_version
The version number of this structure.
Definition: MQTTAsync.h:1432
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
-struct pollfd * fds
poll read file descriptors
Definition: Socket.h:126
-int timeout
The client delays disconnection for up to this time (in milliseconds) in order to allow in-flight mes...
Definition: MQTTAsync.h:1411
+int timeout
The client delays disconnection for up to this time (in milliseconds) in order to allow in-flight mes...
Definition: MQTTAsync.h:1437
#define ARRAY_SIZE(a)
Macro to determine the number of elements in a single-dimension array.
Definition: utf-8.c:37
-const char * enabledCipherSuites
The list of cipher suites that the client will present to the server during the SSL handshake.
Definition: MQTTAsync.h:1092
-int struct_version
The version number of this structure.
Definition: MQTTAsync.h:547
-void * ssl_error_context
Application-specific contex for OpenSSL error handler ERR_print_errors_cb Exists only if struct_versi...
Definition: MQTTClient.h:732
+const char * enabledCipherSuites
The list of cipher suites that the client will present to the server during the SSL handshake.
Definition: MQTTAsync.h:1106
+int struct_version
The version number of this structure.
Definition: MQTTAsync.h:552
+void * ssl_error_context
Application-specific contex for OpenSSL error handler ERR_print_errors_cb Exists only if struct_versi...
Definition: MQTTClient.h:744
void SocketBuffer_interrupted(SOCKET socket, size_t actual_len)
A socket read was interrupted so we need to queue data.
Definition: SocketBuffer.c:252
-MQTTProperties properties
MQTT V5 input properties.
Definition: MQTTAsync.h:1433
-enum MQTTReasonCodes reasonCode
MQTT V5 reason code returned.
Definition: MQTTAsync.h:602
-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:2241
-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:1041
+MQTTProperties properties
MQTT V5 input properties.
Definition: MQTTAsync.h:1459
+enum MQTTReasonCodes reasonCode
MQTT V5 reason code returned.
Definition: MQTTAsync.h:607
+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
+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
struct MQTTAsync_successData5::@4::@6 pub
For publish, the message being sent to the server.
-int struct_version
The version number of this structure.
Definition: MQTTAsync.h:955
+int struct_version
The version number of this structure.
Definition: MQTTAsync.h:969
char * clientID
string client id
Definition: MQTTPacket.h:121
-char struct_id[4]
The eyecatcher for this structure.
Definition: MQTTClient.h:809
-int sslVersion
The SSL/TLS version to use.
Definition: MQTTAsync.h:1101
-int MQTTClient_unsubscribe(MQTTClient handle, const char *topic)
This function attempts to remove an existing subscription made by the specified client.
Definition: MQTTClient.c:2258
+char struct_id[4]
The eyecatcher for this structure.
Definition: MQTTClient.h:827
+int sslVersion
The SSL/TLS version to use.
Definition: MQTTAsync.h:1115
+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
bool password
3.1 password
Definition: MQTTPacket.h:114
-int Socket_close_only(SOCKET socket)
Close a socket without removing it from the select list.
Definition: Socket.c:833
+int Socket_close_only(SOCKET socket)
Close a socket without removing it from the select list.
Definition: Socket.c:862
int msgId
MQTT message id.
Definition: MQTTPacket.h:174
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
struct MQTTClient_willOptions::@17 payload
The LWT payload in binary form.
int payloadlen
payload length
Definition: MQTTPacket.h:204
union MQTTAsync_successData::@1 alt
A union of the different values that can be returned for subscribe, unsubscribe and publish.
-int maxInflight
This controls how many messages can be in-flight simultaneously.
Definition: MQTTAsync.h:1230
+int maxInflight
This controls how many messages can be in-flight simultaneously.
Definition: MQTTAsync.h:1249
willMessages * will
the MQTT will message, if any
Definition: Clients.h:137
Data for a connect packet.
Definition: MQTTPacket.h:89
-int disableDefaultTrustStore
Don't load default SSL CA.
Definition: MQTTAsync.h:1147
-static int MQTTProtocol_queueAck(Clients *client, int ackType, int msgId)
Queue an ack message.
Definition: MQTTProtocolClient.c:834
-int struct_version
The version number of this structure.
Definition: MQTTClient.h:273
+int disableDefaultTrustStore
Don't load default SSL CA.
Definition: MQTTAsync.h:1161
+static int MQTTProtocol_queueAck(Clients *client, int ackType, int msgId)
Queue an ack message.
Definition: MQTTProtocolClient.c:850
+int struct_version
The version number of this structure.
Definition: MQTTClient.h:277
char * SocketBuffer_complete(SOCKET socket)
A socket read has now completed so we can get rid of the queue.
Definition: SocketBuffer.c:281
void ListEmpty(List *aList)
Removes and frees all items in a list, leaving the list ready for new items.
Definition: LinkedList.c:359
-int struct_version
The version number of this structure.
Definition: MQTTClient.h:230
+int struct_version
The version number of this structure.
Definition: MQTTClient.h:234
int struct_version
The version number of this structure.
Definition: MQTTSubscribeOpts.h:41
int messageIDCompare(void *a, void *b)
List callback function for comparing Message structures by message id.
Definition: MQTTProtocolClient.c:73
static const char * UTF8_char_validate(int len, const char *data)
Validate a single UTF-8 character.
Definition: utf-8.c:76
-int do_openssl_init
1 = we do openssl init, 0 = leave it to the application
Definition: MQTTClient.h:232
-The data returned on completion of a successful API call in the response callback onSuccess.
Definition: MQTTAsync.h:596
-const char * CApath
From the OpenSSL documentation: If CApath is not NULL, it points to a directory containing CA certifi...
Definition: MQTTAsync.h:1115
+int do_openssl_init
1 = we do openssl init, 0 = leave it to the application
Definition: MQTTClient.h:236
+The data returned on completion of a successful API call in the response callback onSuccess.
Definition: MQTTAsync.h:601
+const char * CApath
From the OpenSSL documentation: If CApath is not NULL, it points to a directory containing CA certifi...
Definition: MQTTAsync.h:1129
Persistence_keys pkeys
A function pointer to an implementation of Persistence_keys().
Definition: MQTTClientPersistence.h:243
-unsigned char readChar(char **pptr)
Reads one character from the input buffer.
Definition: MQTTPacket.c:425
+unsigned char readChar(char **pptr)
Reads one character from the input buffer.
Definition: MQTTPacket.c:428
void SocketBuffer_queueChar(SOCKET socket, char c)
Queued a Charactor to a specific socket.
Definition: SocketBuffer.c:303
int max_count
max number of properties that the currently allocated array can store
Definition: MQTTProperties.h:115
-int MQTTProtocol_handlePubrels(void *pack, SOCKET sock)
Process an incoming pubrel packet for a socket.
Definition: MQTTProtocolClient.c:553
+int MQTTProtocol_handlePubrels(void *pack, SOCKET sock)
Process an incoming pubrel packet for a socket.
Definition: MQTTProtocolClient.c:565
static Tree heap
Tree that holds the allocation records.
Definition: Heap.c:79
-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:1677
-Options for the ::MQTTAsync_disconnect call.
Definition: MQTTAsync.h:1401
+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
+Options for the ::MQTTAsync_disconnect call.
Definition: MQTTAsync.h:1427
Persistence_remove premove
A function pointer to an implementation of Persistence_remove().
Definition: MQTTClientPersistence.h:239
-MQTTClient_nameValue * MQTTClient_getVersionInfo(void)
This function returns version information about the library.
Definition: MQTTClient.c:2900
+MQTTClient_nameValue * MQTTClient_getVersionInfo(void)
This function returns version information about the library.
Definition: MQTTClient.c:2962
MQTTProperties properties
MQTT 5.0 properties.
Definition: MQTTPacket.h:206
MQTTProperties properties
MQTT 5.0 properties.
Definition: MQTTPacket.h:189
int MQTTProtocol_startPublish(Clients *pubclient, Publish *publish, int qos, int retained, Messages **mm)
Start a new publish exchange.
Definition: MQTTProtocolClient.c:171
-int payloadlen
The length of the MQTT message payload in bytes.
Definition: MQTTClient.h:275
+int payloadlen
The length of the MQTT message payload in bytes.
Definition: MQTTClient.h:279
static FILE * trace_destination
flag to indicate if trace is to be sent to a stream
Definition: Log.c:103
int SocketBuffer_newDefQ(void)
Create a new default queue when one has just been used.
Definition: SocketBuffer.c:79
-const char * MQTTClient_strerror(int code)
Returns a pointer to the string representation of the error or NULL.
Definition: MQTTClient.c:2936
+const char * MQTTClient_strerror(int code)
Returns a pointer to the string representation of the error or NULL.
Definition: MQTTClient.c:2998
Node * root
root node pointer
Definition: Tree.h:80
unsigned char byte
holds the value of a byte property type
Definition: MQTTProperties.h:99
List * ListInitialize(void)
Allocates and initializes a new list structure.
Definition: LinkedList.c:52
@@ -594,57 +595,55 @@