29 #ifndef IOT_MQTT_INTERNAL_H_ 30 #define IOT_MQTT_INTERNAL_H_ 33 #include "iot_config.h" 53 #if IOT_MQTT_ENABLE_ASSERTS == 1 54 #ifndef IotMqtt_Assert 55 #ifdef Iot_DefaultAssert 56 #define IotMqtt_Assert( expression ) Iot_DefaultAssert( expression ) 58 #error "Asserts are enabled for MQTT, but IotMqtt_Assert is not defined" 62 #define IotMqtt_Assert( expression ) 66 #ifdef IOT_LOG_LEVEL_MQTT 67 #define LIBRARY_LOG_LEVEL IOT_LOG_LEVEL_MQTT 69 #ifdef IOT_LOG_LEVEL_GLOBAL 70 #define LIBRARY_LOG_LEVEL IOT_LOG_LEVEL_GLOBAL 72 #define LIBRARY_LOG_LEVEL IOT_LOG_NONE 76 #define LIBRARY_LOG_NAME ( "MQTT" ) 83 #if IOT_STATIC_MEMORY_ONLY == 1 105 #define IotMqtt_MallocMessage Iot_MallocMessageBuffer 112 #define IotMqtt_FreeMessage Iot_FreeMessageBuffer 142 #ifndef IotMqtt_MallocConnection 143 #ifdef Iot_DefaultMalloc 144 #define IotMqtt_MallocConnection Iot_DefaultMalloc 146 #error "No malloc function defined for IotMqtt_MallocConnection" 150 #ifndef IotMqtt_FreeConnection 151 #ifdef Iot_DefaultFree 152 #define IotMqtt_FreeConnection Iot_DefaultFree 154 #error "No free function defined for IotMqtt_FreeConnection" 158 #ifndef IotMqtt_MallocMessage 159 #ifdef Iot_DefaultMalloc 160 #define IotMqtt_MallocMessage Iot_DefaultMalloc 162 #error "No malloc function defined for IotMqtt_MallocMessage" 166 #ifndef IotMqtt_FreeMessage 167 #ifdef Iot_DefaultFree 168 #define IotMqtt_FreeMessage Iot_DefaultFree 170 #error "No free function defined for IotMqtt_FreeMessage" 174 #ifndef IotMqtt_MallocOperation 175 #ifdef Iot_DefaultMalloc 176 #define IotMqtt_MallocOperation Iot_DefaultMalloc 178 #error "No malloc function defined for IotMqtt_MallocOperation" 182 #ifndef IotMqtt_FreeOperation 183 #ifdef Iot_DefaultFree 184 #define IotMqtt_FreeOperation Iot_DefaultFree 186 #error "No free function defined for IotMqtt_FreeOperation" 190 #ifndef IotMqtt_MallocSubscription 191 #ifdef Iot_DefaultMalloc 192 #define IotMqtt_MallocSubscription Iot_DefaultMalloc 194 #error "No malloc function defined for IotMqtt_MallocSubscription" 198 #ifndef IotMqtt_FreeSubscription 199 #ifdef Iot_DefaultFree 200 #define IotMqtt_FreeSubscription Iot_DefaultFree 202 #error "No free function defined for IotMqtt_FreeSubscription" 213 #ifndef AWS_IOT_MQTT_ENABLE_METRICS 214 #define AWS_IOT_MQTT_ENABLE_METRICS ( 1 ) 216 #ifndef IOT_MQTT_ENABLE_SERIALIZER_OVERRIDES 217 #define IOT_MQTT_ENABLE_SERIALIZER_OVERRIDES ( 0 ) 219 #ifndef IOT_MQTT_RESPONSE_WAIT_MS 220 #define IOT_MQTT_RESPONSE_WAIT_MS ( 1000U ) 222 #ifndef IOT_MQTT_RETRY_MS_CEILING 223 #define IOT_MQTT_RETRY_MS_CEILING ( 60000U ) 227 #define MQTT_SERVER_MAX_CLIENTID_LENGTH ( ( uint16_t ) 23 ) 228 #define MQTT_SERVER_MAX_PUBLISH_PAYLOAD_LENGTH ( ( size_t ) ( 268435456 ) ) 229 #define MQTT_SERVER_MAX_LWT_PAYLOAD_LENGTH ( ( size_t ) UINT16_MAX ) 239 #define AWS_IOT_MQTT_SERVER_MAX_CLIENTID_LENGTH ( ( uint16_t ) 128 ) 240 #define AWS_IOT_MQTT_SERVER_MAX_TOPIC_LENGTH ( ( uint16_t ) 256 ) 241 #define AWS_IOT_MQTT_SERVER_MAX_TOPIC_FILTERS_PER_SUBSCRIBE ( ( size_t ) 8 ) 242 #define AWS_IOT_MQTT_SERVER_MAX_PUBLISH_PAYLOAD_LENGTH ( ( size_t ) ( 131072 ) ) 251 #define MQTT_PACKET_TYPE_CONNECT ( ( uint8_t ) 0x10U ) 252 #define MQTT_PACKET_TYPE_CONNACK ( ( uint8_t ) 0x20U ) 253 #define MQTT_PACKET_TYPE_PUBLISH ( ( uint8_t ) 0x30U ) 254 #define MQTT_PACKET_TYPE_PUBACK ( ( uint8_t ) 0x40U ) 255 #define MQTT_PACKET_TYPE_SUBSCRIBE ( ( uint8_t ) 0x82U ) 256 #define MQTT_PACKET_TYPE_SUBACK ( ( uint8_t ) 0x90U ) 257 #define MQTT_PACKET_TYPE_UNSUBSCRIBE ( ( uint8_t ) 0xa2U ) 258 #define MQTT_PACKET_TYPE_UNSUBACK ( ( uint8_t ) 0xb0U ) 259 #define MQTT_PACKET_TYPE_PINGREQ ( ( uint8_t ) 0xc0U ) 260 #define MQTT_PACKET_TYPE_PINGRESP ( ( uint8_t ) 0xd0U ) 261 #define MQTT_PACKET_TYPE_DISCONNECT ( ( uint8_t ) 0xe0U ) 268 #define MQTT_REMAINING_LENGTH_INVALID ( ( size_t ) 268435456 ) 278 #define MQTT_INTERNAL_FLAG_BLOCK_ON_SEND ( 0x80000000U ) 289 #define MQTT_REMOVE_ALL_SUBSCRIPTIONS ( -1 ) 308 typedef struct _mqttOperation
366 uint32_t nextPeriodMs;
409 typedef struct _mqttSubscription
447 typedef struct _mqttPacket
578 uint8_t ** pConnectPacket,
579 size_t * pPacketSize );
608 uint8_t ** pPublishPacket,
609 size_t * pPacketSize,
610 uint16_t * pPacketIdentifier,
611 uint8_t ** pPacketIdentifierHigh );
626 uint8_t * pPacketIdentifierHigh,
627 uint16_t * pNewPacketIdentifier );
653 uint8_t ** pPubackPacket,
654 size_t * pPacketSize );
681 size_t subscriptionCount,
682 uint8_t ** pSubscribePacket,
683 size_t * pPacketSize,
684 uint16_t * pPacketIdentifier );
711 size_t subscriptionCount,
712 uint8_t ** pUnsubscribePacket,
713 size_t * pPacketSize,
714 uint16_t * pPacketIdentifier );
738 size_t * pPacketSize );
762 size_t * pPacketSize );
885 const uint16_t * pPacketIdentifier );
912 uint16_t subscribePacketIdentifier,
914 size_t subscriptionCount );
938 uint16_t packetIdentifier,
951 size_t subscriptionCount );
987 uint8_t * pIncomingByte );
1003 #if IOT_MQTT_ENABLE_SERIALIZER_OVERRIDES == 1 1008 #define SERIALIZER_OVERRIDE_SELECTOR( funcType_t, funcName, defaultFunc, serializerMember ) \ 1009 static funcType_t funcName( const IotMqttSerializer_t * pSerializer ); \ 1010 static funcType_t funcName( const IotMqttSerializer_t * pSerializer ) \ 1012 funcType_t returnValue = defaultFunc; \ 1013 if( pSerializer != NULL ) \ 1015 if( pSerializer->serializerMember != NULL ) \ 1017 returnValue = pSerializer->serializerMember; \ 1021 return returnValue; \ IotMqttError_t _IotMqtt_DeserializePingresp(_mqttPacket_t *pPingresp)
Deserialize a PINGRESP packet.
Definition: iot_mqtt_serialize.c:963
IotMqttCallbackInfo_t disconnectCallback
A function to invoke when this connection is disconnected.
Definition: iot_mqtt_internal.h:389
IotMqttError_t
Return codes of MQTT functions.
Definition: iot_mqtt_types.h:106
void IotMqtt_FreeOperation(void *ptr)
Free an _mqttOperation_t. This function should have the same signature as free.
Definition: iot_mqtt_static_memory.c:157
bool awsIotMqttMode
Specifies if this connection is to an AWS IoT MQTT server.
Definition: iot_mqtt_internal.h:385
void _IotMqtt_RemoveSubscriptionByPacket(_mqttConnection_t *pMqttConnection, uint16_t packetIdentifier, int32_t order)
Remove a single subscription from the subscription manager by packetIdentifier and order...
Definition: iot_mqtt_subscription.c:571
void IotMqtt_FreeConnection(void *ptr)
Free an _mqttConnection_t. This function should have the same signature as free.
Definition: iot_mqtt_static_memory.c:122
MQTT callback function and context.
Definition: iot_mqtt_types.h:518
void _IotMqtt_CloseNetworkConnection(IotMqttDisconnectReason_t disconnectReason, _mqttConnection_t *pMqttConnection)
Closes the network connection associated with an MQTT connection.
Definition: iot_mqtt_network.c:725
size_t order
Order in the packet's list of subscriptions.
Definition: iot_mqtt_internal.h:428
_mqttOperation_t pingreq
Operation used for MQTT keep-alive.
Definition: iot_mqtt_internal.h:403
_mqttConnection_t * pMqttConnection
(Input) MQTT connection associated with this packet. Only used when deserializing SUBACKs...
Definition: iot_mqtt_internal.h:458
Represents an MQTT connection.
Definition: iot_mqtt_internal.h:383
uint8_t _IotMqtt_GetPacketType(IotNetworkConnection_t pNetworkConnection, const IotNetworkInterface_t *pNetworkInterface)
Get the MQTT packet type from a stream of bytes off the network.
Definition: iot_mqtt_serialize.c:210
IotMqttError_t status
Result of this operation. This is reported once a response is received.
Definition: iot_mqtt_internal.h:348
IotMqttError_t _IotMqtt_SerializePuback(uint16_t packetIdentifier, uint8_t **pPubackPacket, size_t *pPacketSize)
Generate a PUBACK packet for the given packet identifier.
Definition: iot_mqtt_serialize.c:630
void * pReceivedData
Any buffer associated with this PUBLISH that should be freed.
Definition: iot_mqtt_internal.h:375
IotMqttError_t _IotMqtt_SerializeConnect(const IotMqttConnectInfo_t *pConnectInfo, uint8_t **pConnectPacket, size_t *pPacketSize)
Generate a CONNECT packet from the given parameters.
Definition: iot_mqtt_serialize.c:281
uint16_t identifier
Packet identifier.
Definition: iot_mqtt_internal.h:427
IotListDouble_t subscriptionList
Holds subscriptions associated with this connection.
Definition: iot_mqtt_internal.h:399
IotTaskPoolJob_t job
Task pool job associated with this operation.
Definition: iot_mqtt_internal.h:317
_mqttOperation_t * _IotMqtt_FindOperation(_mqttConnection_t *pMqttConnection, IotMqttOperationType_t type, const uint16_t *pPacketIdentifier)
Search a list of MQTT operations pending responses using an operation name and packet identifier...
Definition: iot_mqtt_operation.c:1193
IotMqttError_t _IotMqtt_DeserializePuback(_mqttPacket_t *pPuback)
Deserialize a PUBACK packet.
Definition: iot_mqtt_serialize.c:666
IotListDouble_t pendingResponse
List of processed operations awaiting a server response.
Definition: iot_mqtt_internal.h:397
struct _taskPoolJob * IotTaskPoolJob_t
uint32_t count
Current number of retries.
Definition: iot_mqtt_internal.h:357
bool _IotMqtt_ValidateSubscriptionList(IotMqttOperationType_t operation, bool awsIotMqttMode, const IotMqttSubscription_t *pListStart, size_t listSize)
Check that a list of IotMqttSubscription_t is valid.
Definition: iot_mqtt_validate.c:716
void _IotMqtt_ProcessSend(IotTaskPool_t pTaskPool, IotTaskPoolJob_t pSendJob, void *pContext)
Task pool routine for processing an MQTT operation to send.
Definition: iot_mqtt_operation.c:998
uint16_t topicFilterLength
Length of _mqttSubscription_t.pTopicFilter.
Definition: iot_mqtt_internal.h:433
Function pointers for MQTT packet serializer overrides.
Definition: iot_mqtt_types.h:867
IotSemaphore_t waitSemaphore
Semaphore to be used with IotMqtt_Wait.
Definition: iot_mqtt_internal.h:345
void _IotMqtt_InvokeSubscriptionCallback(_mqttConnection_t *pMqttConnection, IotMqttCallbackParam_t *pCallbackParam)
Process a received PUBLISH from the server, invoking any subscription callbacks that have a matching ...
Definition: iot_mqtt_subscription.c:471
IotMqttError_t _IotMqtt_DeserializeSuback(_mqttPacket_t *pSuback)
Deserialize a SUBACK packet.
Definition: iot_mqtt_serialize.c:776
bool _IotMqtt_ValidatePublish(bool awsIotMqttMode, const IotMqttPublishInfo_t *pPublishInfo, uint32_t flags, const IotMqttCallbackInfo_t *pCallbackInfo, const IotMqttOperation_t *const pPublishOperation)
Check that parameters for an MQTT PUBLISH are valid.
Definition: iot_mqtt_validate.c:614
IotMqttError_t _IotMqtt_ScheduleOperation(_mqttOperation_t *pOperation, IotTaskPoolRoutine_t jobRoutine, uint32_t delay)
Schedule an operation for immediate processing.
Definition: iot_mqtt_operation.c:1144
IotMqttPublishInfo_t publishInfo
Deserialized PUBLISH.
Definition: iot_mqtt_internal.h:374
uint32_t limit
Maximum number of retries allowed.
Definition: iot_mqtt_internal.h:358
uint32_t nextPeriodMs
Next retry period.
Definition: iot_mqtt_internal.h:359
struct _mqttConnection * pMqttConnection
MQTT connection associated with this operation.
Definition: iot_mqtt_internal.h:314
Information on a PUBLISH message.
Definition: iot_mqtt_types.h:395
Represents an MQTT packet received from the network.
Definition: iot_mqtt_internal.h:447
bool incomingPublish
Set to true if this operation is an incoming PUBLISH.
Definition: iot_mqtt_internal.h:313
size_t remainingLength
(Input) Length of the remaining data in the MQTT packet.
Definition: iot_mqtt_internal.h:468
bool _IotMqtt_ValidateLwtPublish(bool awsIotMqttMode, const IotMqttPublishInfo_t *pLwtPublishInfo)
Check that an IotMqttPublishInfo_t is valid for an LWT publish.
Definition: iot_mqtt_validate.c:678
static IotMqttConnection_t _mqttConnection
An MQTT connection to share among the tests.
Definition: iot_tests_mqtt_system.c:194
bool disconnected
Tracks if this connection has been disconnected.
Definition: iot_mqtt_internal.h:393
void IotMqtt_FreeSubscription(void *ptr)
Free an _mqttSubscription_t. This function should have the same signature as free.
Definition: iot_mqtt_static_memory.c:191
IotMqttError_t _IotMqtt_DeserializeConnack(_mqttPacket_t *pConnack)
Deserialize a CONNACK packet.
Definition: iot_mqtt_serialize.c:331
User-facing functions of the MQTT 3.1.1 library.
uint8_t * pMqttPacket
The MQTT packet to send over the network.
Definition: iot_mqtt_internal.h:334
bool ownNetworkConnection
Whether this MQTT connection owns its network connection.
Definition: iot_mqtt_internal.h:386
void _IotMqtt_PublishSetDup(uint8_t *pPublishPacket, uint8_t *pPacketIdentifierHigh, uint16_t *pNewPacketIdentifier)
Set the DUP bit in a QoS 1 PUBLISH packet.
Definition: iot_mqtt_serialize.c:503
MQTT subscription.
Definition: iot_mqtt_types.h:553
IotMutex_t subscriptionMutex
Grants exclusive access to the subscription list.
Definition: iot_mqtt_internal.h:400
void _IotMqtt_ProcessIncomingPublish(IotTaskPool_t pTaskPool, IotTaskPoolJob_t pPublishJob, void *pContext)
Task pool routine for processing an incoming PUBLISH message.
Definition: iot_mqtt_operation.c:958
IotMqttError_t _IotMqtt_SerializeSubscribe(const IotMqttSubscription_t *pSubscriptionList, size_t subscriptionCount, uint8_t **pSubscribePacket, size_t *pPacketSize, uint16_t *pPacketIdentifier)
Generate a SUBSCRIBE packet from the given parameters.
Definition: iot_mqtt_serialize.c:715
const IotMqttSerializer_t * pSerializer
MQTT packet serializer overrides.
Definition: iot_mqtt_internal.h:391
MQTT connection details.
Definition: iot_mqtt_types.h:589
bool _IotMqtt_DecrementOperationReferences(_mqttOperation_t *pOperation, bool cancelJob)
Decrement the job reference count of an MQTT operation and optionally cancel its job.
Definition: iot_mqtt_operation.c:675
IotMqttError_t _IotMqtt_DeserializeUnsuback(_mqttPacket_t *pUnsuback)
Deserialize a UNSUBACK packet.
Definition: iot_mqtt_serialize.c:886
IotMqttCallbackInfo_t callback
User-provided callback function and parameter.
Definition: iot_mqtt_internal.h:346
uint8_t * pPacketIdentifierHigh
The location of the high byte of the packet identifier in the MQTT packet.
Definition: iot_mqtt_internal.h:335
void * IotMqtt_MallocConnection(size_t size)
Allocate an _mqttConnection_t. This function should have the same signature as malloc.
Definition: iot_mqtt_static_memory.c:99
IotNetworkConnection_t pNetworkConnection
References the transport-layer network connection.
Definition: iot_mqtt_internal.h:387
void _IotMqtt_DestroyOperation(_mqttOperation_t *pOperation)
Free resources used to record an MQTT operation. This is called when the operation completes...
Definition: iot_mqtt_operation.c:735
bool _IotMqtt_ValidateConnect(const IotMqttConnectInfo_t *pConnectInfo)
Check that an IotMqttConnectInfo_t is valid.
Definition: iot_mqtt_validate.c:567
IotListDouble_t pendingProcessing
List of operations waiting to be processed by a task pool routine.
Definition: iot_mqtt_internal.h:396
bool unsubscribed
Tracks whether an unsubscribe function has been called for this subscription.
Definition: iot_mqtt_internal.h:423
IotMutex_t referencesMutex
Recursive mutex. Grants access to connection state and operation lists.
Definition: iot_mqtt_internal.h:394
void _IotMqtt_FreePacket(uint8_t *pPacket)
Free a packet generated by the serializer.
Definition: iot_mqtt_serialize.c:1024
bool _IotMqtt_ValidateOperation(IotMqttOperation_t operation)
Check that an IotMqttOperation_t is valid and waitable.
Definition: iot_mqtt_validate.c:689
IotMqttDisconnectReason_t
The reason that an MQTT connection (and its associated network connection) was disconnected.
Definition: iot_mqtt_types.h:323
size_t packetSize
Size of pMqttPacket.
Definition: iot_mqtt_internal.h:336
uint16_t packetIdentifier
The packet identifier used with this operation.
Definition: iot_mqtt_internal.h:331
struct _taskPool * IotTaskPool_t
int32_t jobReference
Tracks if a job is using this operation. Must always be 0, 1, or 2.
Definition: iot_mqtt_internal.h:328
uint32_t keepAliveMs
Keep-alive interval in milliseconds. Its max value (per spec) is 65,535,000.
Definition: iot_mqtt_internal.h:365
void * IotMqtt_MallocOperation(size_t size)
Allocate an _mqttOperation_t. This function should have the same signature as malloc.
Definition: iot_mqtt_static_memory.c:134
void _IotMqtt_RemoveSubscriptionByTopicFilter(_mqttConnection_t *pMqttConnection, const IotMqttSubscription_t *pSubscriptionList, size_t subscriptionCount)
Remove an array of subscriptions from the subscription manager by topic filter.
Definition: iot_mqtt_subscription.c:592
_mqttOperation_t * pIncomingPublish
(Output) Operation representing an incoming PUBLISH. Only used when deserializing PUBLISHes...
Definition: iot_mqtt_internal.h:464
struct _mqttOperation * IotMqttOperation_t
Opaque handle that references an in-progress MQTT operation.
Definition: iot_mqtt_types.h:90
uint32_t flags
Flags passed to the function that created this operation.
Definition: iot_mqtt_internal.h:330
IotMqttOperationType_t
Types of MQTT operations.
Definition: iot_mqtt_types.h:280
void _IotMqtt_ProcessCompletedOperation(IotTaskPool_t pTaskPool, IotTaskPoolJob_t pOperationJob, void *pContext)
Task pool routine for processing a completed MQTT operation.
Definition: iot_mqtt_operation.c:1107
IotMqttError_t _IotMqtt_CreateOperation(_mqttConnection_t *pMqttConnection, uint32_t flags, const IotMqttCallbackInfo_t *pCallbackInfo, _mqttOperation_t **pNewOperation)
Create a record for a new in-progress MQTT operation.
Definition: iot_mqtt_operation.c:580
IotMqttError_t _IotMqtt_SerializePublish(const IotMqttPublishInfo_t *pPublishInfo, uint8_t **pPublishPacket, size_t *pPacketSize, uint16_t *pPacketIdentifier, uint8_t **pPacketIdentifierHigh)
Generate a PUBLISH packet from the given parameters.
Definition: iot_mqtt_serialize.c:445
uint32_t failure
Flag tracking keep-alive status.
Definition: iot_mqtt_internal.h:364
void * IotMqtt_MallocSubscription(size_t size)
Allocate an _mqttSubscription_t. This function should have the same signature as malloc.
Definition: iot_mqtt_static_memory.c:169
IotMqttCallbackInfo_t callback
Callback information for this subscription.
Definition: iot_mqtt_internal.h:431
const IotNetworkInterface_t * pNetworkInterface
Network interface provided to IotMqtt_Connect.
Definition: iot_mqtt_internal.h:388
uint16_t packetIdentifier
(Output) MQTT packet identifier.
Definition: iot_mqtt_internal.h:469
int32_t references
How many subscription callbacks are using this subscription.
Definition: iot_mqtt_internal.h:413
IotLink_t link
List link member.
Definition: iot_mqtt_internal.h:311
IotMqttError_t _IotMqtt_SerializeUnsubscribe(const IotMqttSubscription_t *pSubscriptionList, size_t subscriptionCount, uint8_t **pUnsubscribePacket, size_t *pPacketSize, uint16_t *pPacketIdentifier)
Generate an UNSUBSCRIBE packet from the given parameters.
Definition: iot_mqtt_serialize.c:825
IotMqttError_t _IotMqtt_SerializePingreq(uint8_t **pPingreqPacket, size_t *pPacketSize)
Generate a PINGREQ packet.
Definition: iot_mqtt_serialize.c:936
uint64_t lastMessageTime
When the most recent message was transmitted.
Definition: iot_mqtt_internal.h:402
int32_t references
Counts callbacks and operations using this connection.
Definition: iot_mqtt_internal.h:395
bool _IotMqtt_IncrementConnectionReferences(_mqttConnection_t *pMqttConnection)
Attempt to increment the reference count of an MQTT connection.
Definition: iot_mqtt_api.c:1085
Represents a subscription stored in an MQTT connection.
Definition: iot_mqtt_internal.h:409
IotMqttOperationType_t type
What operation this structure represents.
Definition: iot_mqtt_internal.h:329
IotMqttError_t _IotMqtt_SerializeDisconnect(uint8_t **pDisconnectPacket, size_t *pPacketSize)
Generate a DISCONNECT packet.
Definition: iot_mqtt_serialize.c:997
void _IotMqtt_Notify(_mqttOperation_t *pOperation)
Notify of a completed MQTT operation.
Definition: iot_mqtt_operation.c:1299
size_t _IotMqtt_GetRemainingLength(IotNetworkConnection_t pNetworkConnection, const IotNetworkInterface_t *pNetworkInterface)
Get the remaining length from a stream of bytes off the network.
Definition: iot_mqtt_serialize.c:225
IotTaskPoolJobStorage_t jobStorage
Task pool job storage associated with this operation.
Definition: iot_mqtt_internal.h:316
Internal structure representing a single MQTT operation, such as CONNECT, SUBSCRIBE, PUBLISH, etc.
Definition: iot_mqtt_internal.h:308
IotLink_t link
List link member.
Definition: iot_mqtt_internal.h:411
void _IotMqtt_ProcessKeepAlive(IotTaskPool_t pTaskPool, IotTaskPoolJob_t pKeepAliveJob, void *pContext)
Task pool routine for processing an MQTT connection's keep-alive.
Definition: iot_mqtt_operation.c:816
IotMqttError_t _IotMqtt_DeserializePublish(_mqttPacket_t *pPublish)
Deserialize a PUBLISH packet received from the server.
Definition: iot_mqtt_serialize.c:538
void _IotMqtt_DecrementConnectionReferences(_mqttConnection_t *pMqttConnection)
Decrement the reference count of an MQTT connection.
Definition: iot_mqtt_api.c:1125
uint8_t * pRemainingData
(Input) The remaining data in MQTT packet.
Definition: iot_mqtt_internal.h:467
void(* IotTaskPoolRoutine_t)(IotTaskPool_t pTaskPool, IotTaskPoolJob_t pJob, void *pUserContext)
IotMqttError_t _IotMqtt_AddSubscriptions(_mqttConnection_t *pMqttConnection, uint16_t subscribePacketIdentifier, const IotMqttSubscription_t *pSubscriptionList, size_t subscriptionCount)
Add an array of subscriptions to the subscription manager.
Definition: iot_mqtt_subscription.c:386
uint8_t type
(Input) A value identifying the packet type.
Definition: iot_mqtt_internal.h:470
bool _IotMqtt_GetNextByte(IotNetworkConnection_t pNetworkConnection, const IotNetworkInterface_t *pNetworkInterface, uint8_t *pIncomingByte)
Read the next available byte on a network connection.
Definition: iot_mqtt_network.c:695
Parameter to an MQTT callback function.
Definition: iot_mqtt_types.h:441