diff --git a/main/annotated.html b/main/annotated.html index a6fc635c..c3dae27e 100644 --- a/main/annotated.html +++ b/main/annotated.html @@ -110,8 +110,9 @@
#include "core_mqtt_state.h"
#include "core_mqtt_config_defaults.h"
+Data Structures | |
struct | MQTTVec_t |
An opaque structure provided by the library to the MQTTStorePacketForRetransmit function when using MQTTStorePacketForRetransmit. More... | |
Macros | |
@@ -209,12 +216,12 @@ | |
static MQTTStatus_t | handleUncleanSessionResumption (MQTTContext_t *pContext) |
Resends pending acks for a re-established MQTT session. | |
static void | handleCleanSession (MQTTContext_t *pContext) |
Clears existing state records for a clean session. | |
static MQTTStatus_t | sendPublishWithoutCopy (MQTTContext_t *pContext, const MQTTPublishInfo_t *pPublishInfo, const uint8_t *pMqttHeader, size_t headerSize, uint16_t packetId) |
Send the publish packet without copying the topic string and payload in the buffer. | |
static MQTTStatus_t | handleCleanSession (MQTTContext_t *pContext) |
Clears existing state records for a clean session. | |
static MQTTStatus_t | sendPublishWithoutCopy (MQTTContext_t *pContext, const MQTTPublishInfo_t *pPublishInfo, uint8_t *pMqttHeader, size_t headerSize, uint16_t packetId) |
Send the publish packet without copying the topic string and payload in the buffer. | |
static MQTTStatus_t | validatePublishParams (const MQTTContext_t *pContext, const MQTTPublishInfo_t *pPublishInfo, uint16_t packetId) |
Function to validate MQTT_Publish parameters. | |
MQTTStatus_t | MQTT_InitStatefulQoS (MQTTContext_t *pContext, MQTTPubAckInfo_t *pOutgoingPublishRecords, size_t outgoingPublishCount, MQTTPubAckInfo_t *pIncomingPublishRecords, size_t incomingPublishCount) |
Initialize an MQTT context for QoS > 0. | |
MQTTStatus_t | MQTT_InitRetransmits (MQTTContext_t *pContext, MQTTStorePacketForRetransmit storeFunction, MQTTRetrievePacketForRetransmit retrieveFunction, MQTTClearPacketForRetransmit clearFunction) |
Initialize an MQTT context for publish retransmits for QoS > 0. | |
MQTTStatus_t | MQTT_CancelCallback (const MQTTContext_t *pContext, uint16_t packetId) |
Cancels an outgoing publish callback (only for QoS > QoS0) by removing it from the pending ACK list. | |
const char * | MQTT_Status_strerror (MQTTStatus_t status) |
Error code to string conversion for MQTT statuses. | |
size_t | MQTT_GetBytesInMQTTVec (MQTTVec_t *pVec) |
Get the bytes in a MQTTVec pointer which can store the whole array as a an MQTT packet when calling MQTT_SerializeMQTTVec( void * pAllocatedMem, MQTTVec_t *pVec ) function. | |
void | MQTT_SerializeMQTTVec (uint8_t *pAllocatedMem, MQTTVec_t *pVec) |
Serialize the bytes in an array of MQTTVec in the provided pAllocatedMem . | |
Implements the user-facing functions in core_mqtt.h.
@@ -1460,8 +1476,8 @@Enumerations | |
MQTTStatus_t | MQTT_InitStatefulQoS (MQTTContext_t *pContext, MQTTPubAckInfo_t *pOutgoingPublishRecords, size_t outgoingPublishCount, MQTTPubAckInfo_t *pIncomingPublishRecords, size_t incomingPublishCount) |
Initialize an MQTT context for QoS > 0. | |
MQTTStatus_t | MQTT_InitRetransmits (MQTTContext_t *pContext, MQTTStorePacketForRetransmit storeFunction, MQTTRetrievePacketForRetransmit retrieveFunction, MQTTClearPacketForRetransmit clearFunction) |
Initialize an MQTT context for publish retransmits for QoS > 0. | |
MQTTStatus_t | MQTT_CheckConnectStatus (MQTTContext_t *pContext) |
Checks the MQTT connection status with the broker. | |
const char * | MQTT_Status_strerror (MQTTStatus_t status) |
Error code to string conversion for MQTT statuses. | |
size_t | MQTT_GetBytesInMQTTVec (MQTTVec_t *pVec) |
Get the bytes in a MQTTVec pointer which can store the whole array as a an MQTT packet when calling MQTT_SerializeMQTTVec( void * pAllocatedMem, MQTTVec_t *pVec ) function. | |
void | MQTT_SerializeMQTTVec (uint8_t *pAllocatedMem, MQTTVec_t *pVec) |
Serialize the bytes in an array of MQTTVec in the provided pAllocatedMem . | |
User-facing functions of the MQTT 3.1.1 library.
-typedef bool(* MQTTStorePacketForRetransmit) (struct MQTTContext *pContext, uint16_t packetId, MQTTVec_t *pMqttVec) | +
User defined callback used to store outgoing publishes. Used to track any publish retransmit on an unclean session connection.
+[in] | pContext | Initialised MQTT Context. |
[in] | packetId | Outgoing publish packet identifier. |
[in] | pMqttVec | Pointer to the opaque mqtt vector structure. Users should use MQTT_SerializeMQTTVec and MQTT_GetBytesInMQTTVec functions to get the memory required and to serialize the MQTTVec_t in the provided memory respectively. |
typedef bool(* MQTTRetrievePacketForRetransmit) (struct MQTTContext *pContext, uint16_t packetId, uint8_t **pSerializedMqttVec, size_t *pSerializedMqttVecLen) | +
User defined callback used to retreive a copied publish for resend operation. Used to track any publish retransmit on an unclean session connection.
+[in] | pContext | Initialised MQTT Context. |
[in] | packetId | Copied publish packet identifier. |
[out] | pSerializedMqttVec | Output parameter to store the pointer to the serialized MQTTVec_t using MQTT_SerializeMQTTVec. |
[out] | pSerializedMqttVecLen | Output parameter to return the number of bytes used to store the MQTTVec_t. This value should be the same as the one received from MQTT_GetBytesInMQTTVec when storing the packet. |
typedef void(* MQTTClearPacketForRetransmit) (struct MQTTContext *pContext, uint16_t packetId) | +
User defined callback used to clear a particular copied publish packet. Used to track any publish retransmit on an unclean session connection.
+[in] | pContext | Initialised MQTT Context. |
[in] | packetId | Copied publish packet identifier. |
MQTTStatus_t MQTT_InitRetransmits | +( | +MQTTContext_t * | +pContext, | +
+ | + | MQTTStorePacketForRetransmit | +storeFunction, | +
+ | + | MQTTRetrievePacketForRetransmit | +retrieveFunction, | +
+ | + | MQTTClearPacketForRetransmit | +clearFunction | +
+ | ) | ++ |
Initialize an MQTT context for publish retransmits for QoS > 0.
+This function must be called on an MQTTContext_t after MQTT_InitstatefulQoS and before any other function.
+[in] | pContext | The context to initialize. |
[in] | storeFunction | User defined API used to store outgoing publishes. |
[in] | retrieveFunction | User defined API used to retreive a copied publish for resend operation. |
[in] | clearFunction | User defined API used to clear a particular copied publish packet. |
Example
timeoutMs
for CONNACK; MQTTSuccess otherwise.timeoutMs
for CONNACK; MQTTStatusConnected if the connection is already established MQTTStatusDisconnectPending if the user is expected to call MQTT_Disconnect before calling any other API MQTTPublishRetrieveFailed if on an unclean session connection, the copied publishes are not retrieved successfully for retransmission MQTTSuccess otherwise.Example
Example
Example
Example
size_t MQTT_GetBytesInMQTTVec | +( | +MQTTVec_t * | +pVec | ) | ++ |
Get the bytes in a MQTTVec pointer which can store the whole array as a an MQTT packet when calling MQTT_SerializeMQTTVec( void * pAllocatedMem, MQTTVec_t *pVec ) function.
+[in] | pVec | The MQTTVec pointer. |
void MQTT_SerializeMQTTVec | +( | +uint8_t * | +pAllocatedMem, | +
+ | + | MQTTVec_t * | +pVec | +
+ | ) | ++ |
Serialize the bytes in an array of MQTTVec in the provided pAllocatedMem
.
[in] | pAllocatedMem | Memory in which to serialize the data in the MQTTVec array. It must be of size provided by MQTT_GetBytesInMQTTVec( MQTTVec_t *pVec ). |
[in] | pVec | The MQTTVec pointer. |
MQTTStatus_t MQTT_UpdateDuplicatePublishFlag | +( | +uint8_t * | +pHeader, | +
+ | + | bool | +set | +
+ | ) | ++ |
Update the duplicate publish flag within the given header of the publish packet.
+[in] | pHeader | The buffer holding the header content |
[in] | set | If true then the flag will be set else cleared |
User-facing functions for serializing and deserializing MQTT 3.1.1 packets. This header should be included for building a lighter weight MQTT client than the managed CSDK MQTT library API in core_mqtt.h, by using the serializer and de-serializer functions exposed in this file's API.
@@ -363,11 +369,11 @@pIncomingPacket
is invalid, MQTTBadResponse if an invalid packet is read, and MQTTNoDataAvailable if there is nothing to read. MQTTStatus_t MQTT_UpdateDuplicatePublishFlag | +( | +uint8_t * | +pHeader, | +
+ | + | bool | +set | +
+ | ) | ++ |
Update the duplicate publish flag within the given header of the publish packet.
+[in] | pHeader | The buffer holding the header content |
[in] | set | If true then the flag will be set else cleared |
MQTT_ProcessLoop/MQTT_ReceiveLoop has received incomplete data; it should be called again (probably after a delay).
MQTT connection is established with the broker
+MQTT connection is established with the broker.
+MQTT connection is not established with the broker.
+Transport Interface has failed and MQTT connection needs to be closed.
MQTT connection is not established with the broker
+User provided API to store a copy of outgoing publish for retransmission purposes, has failed.
Transport Interface has failed and MQTT connection needs to be closed
+User provided API to retrieve the copy of a publish while reconnecting with an unclean session has failed.
Establish an MQTT session.
This function will send MQTT CONNECT packet and receive a CONNACK packet. The send and receive from the network is done through the transport interface.
The maximum time this function waits for a CONNACK is decided in one of the following ways:
timeoutMs
for CONNACK; MQTTSuccess otherwise.timeoutMs
for CONNACK; MQTTStatusConnected if the connection is already established MQTTStatusDisconnectPending if the user is expected to call MQTT_Disconnect before calling any other API MQTTPublishRetrieveFailed if on an unclean session connection, the copied publishes are not retrieved successfully for retransmission MQTTSuccess otherwise.Deserialize an MQTT CONNACK, SUBACK, UNSUBACK, PUBACK, PUBREC, PUBREL, PUBCOMP, or PINGRESP.
Get the size and Remaining Length of an MQTT CONNECT packet.
This function must be called before MQTT_SerializeConnect in order to get the size of the MQTT CONNECT packet that is generated from MQTTConnectInfo_t and optional MQTTPublishInfo_t. The size of the MQTTFixedBuffer_t supplied to MQTT_SerializeConnect must be at least pPacketSize
. The provided pConnectInfo
and pWillInfo
are valid for serialization with MQTT_SerializeConnect only if this function returns MQTTSuccess. The remaining length returned in pRemainingLength
and the packet size returned in pPacketSize
are valid only if this function returns MQTTSuccess.
Get the size of an MQTT DISCONNECT packet.
Extract the MQTT packet type and length from incoming packet.
This function must be called for every incoming packet to retrieve the MQTTPacketInfo_t.type and MQTTPacketInfo_t.remainingLength. A MQTTPacketInfo_t is not valid until this routine has been invoked.
Get a packet ID that is valid according to the MQTT 3.1.1 spec.
Loop to receive packets from the transport interface. Handles keep alive.
Example
Publishes a message to the given topic name.
Example
Get the packet ID of next pending publish to be resent.
This function will need to be called to get the packet for which a publish need to be sent when a session is reestablished. Calling this function repeatedly until packet id is 0 will give all the packets for which a publish need to be resent in the correct order.
Loop to receive packets from the transport interface. Does not handle keep alive.
Serialize an MQTT PUBACK, PUBREC, PUBREL, or PUBCOMP into the given buffer.
Example
Sends MQTT UNSUBSCRIBE for the given list of topic filters to the broker.
Example
A struct representing an MQTT connection.
diff --git a/main/struct_m_q_t_t_vec.html b/main/struct_m_q_t_t_vec.html new file mode 100644 index 00000000..c89e783f --- /dev/null +++ b/main/struct_m_q_t_t_vec.html @@ -0,0 +1,162 @@ + + + + + + + +An opaque structure provided by the library to the MQTTStorePacketForRetransmit function when using MQTTStorePacketForRetransmit. + More...
++Data Fields | |
TransportOutVector_t * | pVector |
size_t | vectorLen |
An opaque structure provided by the library to the MQTTStorePacketForRetransmit function when using MQTTStorePacketForRetransmit.
+TransportOutVector_t* MQTTVec_t::pVector | +
Pointer to transport vector. USER SHOULD NOT ACCESS THIS DIRECTLY - IT IS AN INTERNAL DETAIL AND CAN CHANGE.
+ +size_t MQTTVec_t::vectorLen | +
Length of the transport vector. USER SHOULD NOT ACCESS THIS DIRECTLY - IT IS AN INTERNAL DETAIL AND CAN CHANGE.
+ +