28 #ifndef IOT_MQTT_TYPES_H_ 29 #define IOT_MQTT_TYPES_H_ 32 #include "iot_config.h" 102 typedef enum IotMqttError
276 typedef enum IotMqttOperationType
302 typedef enum IotMqttQos
319 typedef enum IotMqttDisconnectReason
387 typedef struct IotMqttPublishInfo
392 const char * pTopicName;
393 uint16_t topicNameLength;
395 const void * pPayload;
396 size_t payloadLength;
433 typedef struct IotMqttCallbackParam
463 const char * pTopicFilter;
464 uint16_t topicFilterLength;
509 typedef struct IotMqttCallbackInfo
511 void * pCallbackContext;
522 void ( *
function )(
void * pCallbackContext,
543 typedef struct IotMqttSubscription
552 const char * pTopicFilter;
553 uint16_t topicFilterLength;
578 typedef struct IotMqttConnectInfo
652 size_t previousSubscriptionCount;
669 uint16_t keepAliveSeconds;
671 const char * pClientIdentifier;
672 uint16_t clientIdentifierLength;
681 const char * pUserName;
682 uint16_t userNameLength;
683 const char * pPassword;
684 uint16_t passwordLength;
701 typedef struct IotMqttPacketInfo
703 uint8_t * pRemainingData;
704 size_t remainingLength;
705 uint16_t packetIdentifier;
754 uint8_t ** pConnectPacket,
755 size_t * pPacketSize );
763 size_t * pPacketSize );
775 uint8_t ** pPublishPacket,
776 size_t * pPacketSize,
777 uint16_t * pPacketIdentifier,
778 uint8_t ** pPacketIdentifierHigh );
789 size_t subscriptionCount,
790 uint8_t ** pSubscribePacket,
791 size_t * pPacketSize,
792 uint16_t * pPacketIdentifier );
800 size_t * pPacketSize );
815 uint8_t ** pPubackPacket,
816 size_t * pPacketSize );
825 uint8_t * pPacketIdentifierHigh,
826 uint16_t * pNewPacketIdentifier );
834 uint8_t * pNextByte );
836 #if IOT_MQTT_ENABLE_SERIALIZER_OVERRIDES == 1 855 typedef struct IotMqttSerializer
1000 typedef struct IotMqttNetworkInfo
1017 bool createNetworkConnection;
1070 #if IOT_MQTT_ENABLE_SERIALIZER_OVERRIDES == 1 1130 #define IOT_MQTT_NETWORK_INFO_INITIALIZER { .createNetworkConnection = true } 1132 #define IOT_MQTT_SERIALIZER_INITIALIZER { 0 } 1134 #define IOT_MQTT_CONNECT_INFO_INITIALIZER { .cleanSession = true } 1136 #define IOT_MQTT_PUBLISH_INFO_INITIALIZER { .qos = IOT_MQTT_QOS_0 } 1138 #define IOT_MQTT_SUBSCRIPTION_INITIALIZER { .qos = IOT_MQTT_QOS_0 } 1140 #define IOT_MQTT_CALLBACK_INFO_INITIALIZER { 0 } 1142 #define IOT_MQTT_CONNECTION_INITIALIZER NULL 1144 #define IOT_MQTT_OPERATION_INITIALIZER NULL 1146 #define IOT_MQTT_PACKET_INFO_INITIALIZER { .pRemainingData = NULL, remainingLength = 0, packetIdentifier = 0, .type = 0 } 1162 #define IOT_MQTT_FLAG_WAITABLE ( 0x00000001U ) 1172 #define IOT_MQTT_FLAG_CLEANUP_ONLY ( 0x00000001UL ) IotMqttError_t
Return codes of MQTT functions.
Definition: iot_mqtt_types.h:106
MQTT callback function and context.
Definition: iot_mqtt_types.h:518
A blocking MQTT operation timed out.
Definition: iot_mqtt_types.h:220
MQTT operation completed successfully.
Definition: iot_mqtt_types.h:122
Definition: iot_mqtt_types.h:284
uint8_t(* IotMqttGetPacketType_t)(IotNetworkConnection_t pNetworkConnection, const IotNetworkInterface_t *pNetworkInterface)
Get the MQTT packet type from a stream of bytes off the network.
Definition: iot_mqtt_types.h:738
IotMqttError_t(* IotMqttSerializeSubscribe_t)(const IotMqttSubscription_t *pSubscriptionList, size_t subscriptionCount, uint8_t **pSubscribePacket, size_t *pPacketSize, uint16_t *pPacketIdentifier)
SUBSCRIBE/UNSUBSCRIBE packet serializer function.
Definition: iot_mqtt_types.h:800
Definition: iot_mqtt_types.h:283
Definition: iot_mqtt_types.h:325
IotMqttError_t(* IotMqtt_SerializePublish_t)(const IotMqttPublishInfo_t *pPublishInfo, uint8_t **pPublishPacket, size_t *pPacketSize, uint16_t *pPacketIdentifier, uint8_t **pPacketIdentifierHigh)
PUBLISH packet serializer function.
Definition: iot_mqtt_types.h:786
MQTT packet details.
Definition: iot_mqtt_types.h:713
MQTT operation queued, awaiting result.
Definition: iot_mqtt_types.h:132
Definition: iot_mqtt_types.h:282
Function pointers for MQTT packet serializer overrides.
Definition: iot_mqtt_types.h:867
IotMqttError_t(* IotMqttDeserialize_t)(struct _mqttPacket *pMqttPacket)
MQTT packet deserializer function.
Definition: iot_mqtt_types.h:818
void(* IotMqttPublishSetDup_t)(uint8_t *pPublishPacket, uint8_t *pPacketIdentifierHigh, uint16_t *pNewPacketIdentifier)
Set the DUP bit in a QoS 1 PUBLISH packet.
Definition: iot_mqtt_types.h:836
IotMqttError_t(* IotMqttGetNextByte_t)(IotNetworkConnection_t pNetworkContext, uint8_t *pNextByte)
Function pointer to read the next available byte on a network connection.
Definition: iot_mqtt_types.h:845
IotMqttQos_t
Quality of service levels for MQTT PUBLISH messages.
Definition: iot_mqtt_types.h:306
Information on a PUBLISH message.
Definition: iot_mqtt_types.h:395
Definition: iot_mqtt_types.h:327
An API function was called before IotMqtt_Init.
Definition: iot_mqtt_types.h:270
void(* IotMqttFreePacket_t)(uint8_t *pPacket)
Free a packet generated by the serializer.
Definition: iot_mqtt_types.h:757
struct _mqttConnection * IotMqttConnection_t
Opaque handle of an MQTT connection.
Definition: iot_mqtt_types.h:67
Definition: iot_mqtt_types.h:288
MQTT operation failed because of memory allocation failure.
Definition: iot_mqtt_types.h:163
static IotMqttConnection_t _mqttConnection
An MQTT connection to share among the tests.
Definition: iot_tests_mqtt_system.c:194
MQTT subscription.
Definition: iot_mqtt_types.h:553
At least one parameter is invalid.
Definition: iot_mqtt_types.h:152
size_t(* IotMqttGetRemainingLength_t)(IotNetworkConnection_t pNetworkConnection, const IotNetworkInterface_t *pNetworkInterface)
Get the remaining length from a stream of bytes off the network.
Definition: iot_mqtt_types.h:748
Definition: iot_mqtt_types.h:285
IotMqttError_t(* IotMqttSerializeDisconnect_t)(uint8_t **pDisconnectPacket, size_t *pPacketSize)
DISCONNECT packet serializer function.
Definition: iot_mqtt_types.h:811
MQTT connection details.
Definition: iot_mqtt_types.h:589
Definition: iot_mqtt_types.h:308
A CONNECT or at least one subscription was refused by the server.
Definition: iot_mqtt_types.h:241
IotMqttDisconnectReason_t
The reason that an MQTT connection (and its associated network connection) was disconnected.
Definition: iot_mqtt_types.h:323
MQTT operation could not be scheduled, i.e. enqueued for sending.
Definition: iot_mqtt_types.h:191
MQTT operation failed because the network was unusable.
Definition: iot_mqtt_types.h:180
IotMqttError_t(* IotMqttSerializePingreq_t)(uint8_t **pPingreqPacket, size_t *pPacketSize)
PINGREQ packet serializer function.
Definition: iot_mqtt_types.h:774
Definition: iot_mqtt_types.h:286
struct _mqttOperation * IotMqttOperation_t
Opaque handle that references an in-progress MQTT operation.
Definition: iot_mqtt_types.h:90
IotMqttError_t(* IotMqttSerializePuback_t)(uint16_t packetIdentifier, uint8_t **pPubackPacket, size_t *pPacketSize)
PUBACK packet serializer function.
Definition: iot_mqtt_types.h:826
MQTT network connection details.
Definition: iot_mqtt_types.h:1013
IotMqttOperationType_t
Types of MQTT operations.
Definition: iot_mqtt_types.h:280
Initialization failed.
Definition: iot_mqtt_types.h:140
IotMqttError_t(* IotMqttSerializeConnect_t)(const IotMqttConnectInfo_t *pConnectInfo, uint8_t **pConnectPacket, size_t *pPacketSize)
CONNECT packet serializer function.
Definition: iot_mqtt_types.h:765
Definition: iot_mqtt_types.h:310
Definition: iot_mqtt_types.h:309
MQTT response packet received from the network is malformed.
Definition: iot_mqtt_types.h:208
Definition: iot_mqtt_types.h:287
A QoS 1 PUBLISH received no response and the retry limit was reached.
Definition: iot_mqtt_types.h:255
Definition: iot_mqtt_types.h:326
Parameter to an MQTT callback function.
Definition: iot_mqtt_types.h:441