coreMQTT v5.0.0
MQTT 5.0 Client Library
 
Loading...
Searching...
No Matches
core_mqtt_prop_deserializer.c File Reference

Implements the user-facing functions to de-serialize user-properties. More...

#include <string.h>
#include <inttypes.h>
#include <stdbool.h>
#include <assert.h>
#include "core_mqtt_serializer.h"
#include "private/core_mqtt_serializer_private.h"
#include "core_mqtt_config_defaults.h"

Functions

static MQTTStatus_t checkPropBuilderParams (const MQTTPropBuilder_t *mqttPropBuilder, const size_t *currentIndex)
 Checks the parameters to all the internal/external 'get' property functions.
 
static MQTTStatus_t getPropUint8 (const MQTTPropBuilder_t *pPropertyBuilder, size_t *currentIndex, uint8_t propertyId, uint8_t *property)
 Get a uint8 property value from the property builder.
 
static MQTTStatus_t getPropUint16 (const MQTTPropBuilder_t *pPropertyBuilder, size_t *currentIndex, uint8_t propertyId, uint16_t *property)
 Get a uint16 property value from the property builder.
 
static MQTTStatus_t getPropUint32 (const MQTTPropBuilder_t *pPropertyBuilder, size_t *currentIndex, uint8_t propertyId, uint32_t *property)
 Get a uint32 property value from the property builder.
 
static MQTTStatus_t getPropUtf8 (const MQTTPropBuilder_t *pPropertyBuilder, size_t *currentIndex, uint8_t propertyId, const char **property, size_t *propertyLength)
 Get a UTF-8 string property value from the property builder.
 
MQTTStatus_t MQTT_GetNextPropertyType (const MQTTPropBuilder_t *pPropertyBuilder, const size_t *currentIndex, uint8_t *property)
 Get the property type at the current index in the property builder.
 
MQTTStatus_t MQTT_SkipNextProperty (const MQTTPropBuilder_t *pPropertyBuilder, size_t *currentIndex)
 Skip the next property in the property builder without extracting its value.
 
MQTTStatus_t MQTTPropGet_UserProp (const MQTTPropBuilder_t *pPropertyBuilder, size_t *currentIndex, MQTTUserProperty_t *pUserProperty)
 Get User Property from property builder.
 
MQTTStatus_t MQTTPropGet_SessionExpiry (const MQTTPropBuilder_t *pPropertyBuilder, size_t *currentIndex, uint32_t *pSessionExpiry)
 Get Session Expiry Interval property from property builder.
 
MQTTStatus_t MQTTPropGet_ReceiveMax (const MQTTPropBuilder_t *pPropertyBuilder, size_t *currentIndex, uint16_t *pReceiveMax)
 Get Receive Maximum property from property builder.
 
MQTTStatus_t MQTTPropGet_MaxQos (const MQTTPropBuilder_t *pPropertyBuilder, size_t *currentIndex, uint8_t *pMaxQos)
 Get Maximum QoS property from property builder.
 
MQTTStatus_t MQTTPropGet_RetainAvailable (const MQTTPropBuilder_t *pPropertyBuilder, size_t *currentIndex, uint8_t *pRetainAvailable)
 Get Retain Available property from property builder.
 
MQTTStatus_t MQTTPropGet_MaxPacketSize (const MQTTPropBuilder_t *pPropertyBuilder, size_t *currentIndex, uint32_t *pMaxPacketSize)
 Get Maximum Packet Size property from property builder.
 
MQTTStatus_t MQTTPropGet_AssignedClientId (const MQTTPropBuilder_t *pPropertyBuilder, size_t *currentIndex, const char **pClientId, size_t *pClientIdLength)
 Get Assigned Client Identifier property from property builder.
 
MQTTStatus_t MQTTPropGet_TopicAliasMax (const MQTTPropBuilder_t *pPropertyBuilder, size_t *currentIndex, uint16_t *pTopicAliasMax)
 Get Topic Alias Maximum property from property builder.
 
MQTTStatus_t MQTTPropGet_ReasonString (const MQTTPropBuilder_t *pPropertyBuilder, size_t *currentIndex, const char **pReasonString, size_t *pReasonStringLength)
 Get Reason String property from property builder.
 
MQTTStatus_t MQTTPropGet_WildcardId (const MQTTPropBuilder_t *pPropertyBuilder, size_t *currentIndex, uint8_t *pWildcardAvailable)
 Get Wildcard Subscription Available property from property builder.
 
MQTTStatus_t MQTTPropGet_SubsIdAvailable (const MQTTPropBuilder_t *pPropertyBuilder, size_t *currentIndex, uint8_t *pSubsIdAvailable)
 Get Subscription Identifier Available property from property builder.
 
MQTTStatus_t MQTTPropGet_SharedSubAvailable (const MQTTPropBuilder_t *pPropertyBuilder, size_t *currentIndex, uint8_t *pSharedSubAvailable)
 Get Shared Subscription Available property from property builder.
 
MQTTStatus_t MQTTPropGet_ServerKeepAlive (const MQTTPropBuilder_t *pPropertyBuilder, size_t *currentIndex, uint16_t *pServerKeepAlive)
 Get Server Keep Alive property from property builder.
 
MQTTStatus_t MQTTPropGet_ResponseInfo (const MQTTPropBuilder_t *pPropertyBuilder, size_t *currentIndex, const char **pResponseInfo, size_t *pResponseInfoLength)
 Get Response Information property from property builder.
 
MQTTStatus_t MQTTPropGet_ServerRef (const MQTTPropBuilder_t *pPropertyBuilder, size_t *currentIndex, const char **pServerRef, size_t *pServerRefLength)
 Get Server Reference property from property builder.
 
MQTTStatus_t MQTTPropGet_AuthMethod (const MQTTPropBuilder_t *pPropertyBuilder, size_t *currentIndex, const char **pAuthMethod, size_t *pAuthMethodLen)
 Get Authentication Method property from property builder.
 
MQTTStatus_t MQTTPropGet_AuthData (const MQTTPropBuilder_t *pPropertyBuilder, size_t *currentIndex, const char **pAuthData, size_t *pAuthDataLen)
 Get Authentication Data property from property builder.
 
MQTTStatus_t MQTTPropGet_PayloadFormatIndicator (const MQTTPropBuilder_t *pPropertyBuilder, size_t *currentIndex, uint8_t *pPayloadFormat)
 Get Payload Format Indicator property from property builder.
 
MQTTStatus_t MQTTPropGet_MessageExpiryInterval (const MQTTPropBuilder_t *pPropertyBuilder, size_t *currentIndex, uint32_t *pMessageExpiry)
 Get Message Expiry Interval property from property builder.
 
MQTTStatus_t MQTTPropGet_TopicAlias (const MQTTPropBuilder_t *pPropertyBuilder, size_t *currentIndex, uint16_t *pTopicAlias)
 Get Topic Alias property from property builder.
 
MQTTStatus_t MQTTPropGet_ResponseTopic (const MQTTPropBuilder_t *pPropertyBuilder, size_t *currentIndex, const char **pResponseTopic, size_t *pResponseTopicLength)
 Get Response Topic property from property builder.
 
MQTTStatus_t MQTTPropGet_CorrelationData (const MQTTPropBuilder_t *pPropertyBuilder, size_t *currentIndex, const char **pCorrelationData, size_t *pCorrelationDataLength)
 Get Correlation Data property from property builder.
 
MQTTStatus_t MQTTPropGet_SubscriptionId (const MQTTPropBuilder_t *pPropertyBuilder, size_t *currentIndex, uint32_t *pSubscriptionId)
 Get Subscription Identifier property from property builder.
 
MQTTStatus_t MQTTPropGet_ContentType (const MQTTPropBuilder_t *pPropertyBuilder, size_t *currentIndex, const char **pContentType, size_t *pContentTypeLength)
 Get the Content Type property from the property builder.
 

Detailed Description

Implements the user-facing functions to de-serialize user-properties.

Function Documentation

◆ checkPropBuilderParams()

static MQTTStatus_t checkPropBuilderParams ( const MQTTPropBuilder_t mqttPropBuilder,
const size_t *  currentIndex 
)
inlinestatic

Checks the parameters to all the internal/external 'get' property functions.

Parameters
[in]mqttPropBuilderThe property builder struct.
[in]currentIndexThe index of the property in the buffer.
Returns
MQTTSuccess if all the checks pass;

◆ getPropUint8()

static MQTTStatus_t getPropUint8 ( const MQTTPropBuilder_t pPropertyBuilder,
size_t *  currentIndex,
uint8_t  propertyId,
uint8_t *  property 
)
static

Get a uint8 property value from the property builder.

This function extracts a uint8 property value from the property builder at the specified index and validates that it matches the expected property ID.

Parameters
[in]pPropertyBuilderPointer to the property builder containing the properties.
[in,out]currentIndexPointer to the current index in the property buffer. Updated to point past the property on success.
[in]propertyIdExpected property ID to validate against.
[out]propertyPointer to store the extracted uint8 property value.
Returns
MQTTSuccess if the property is successfully extracted; MQTTBadParameter if parameters are invalid or property ID doesn't match.

◆ getPropUint16()

static MQTTStatus_t getPropUint16 ( const MQTTPropBuilder_t pPropertyBuilder,
size_t *  currentIndex,
uint8_t  propertyId,
uint16_t *  property 
)
static

Get a uint16 property value from the property builder.

This function extracts a uint16 property value from the property builder at the specified index and validates that it matches the expected property ID.

Parameters
[in]pPropertyBuilderPointer to the property builder containing the properties.
[in,out]currentIndexPointer to the current index in the property buffer. Updated to point past the property on success.
[in]propertyIdExpected property ID to validate against.
[out]propertyPointer to store the extracted uint16 property value.
Returns
MQTTSuccess if the property is successfully extracted; MQTTBadParameter if parameters are invalid or property ID doesn't match.

◆ getPropUint32()

static MQTTStatus_t getPropUint32 ( const MQTTPropBuilder_t pPropertyBuilder,
size_t *  currentIndex,
uint8_t  propertyId,
uint32_t *  property 
)
static

Get a uint32 property value from the property builder.

This function extracts a uint32 property value from the property builder at the specified index and validates that it matches the expected property ID.

Parameters
[in]pPropertyBuilderPointer to the property builder containing the properties.
[in,out]currentIndexPointer to the current index in the property buffer. Updated to point past the property on success.
[in]propertyIdExpected property ID to validate against.
[out]propertyPointer to store the extracted uint32 property value.
Returns
MQTTSuccess if the property is successfully extracted; MQTTBadParameter if parameters are invalid or property ID doesn't match.

◆ getPropUtf8()

static MQTTStatus_t getPropUtf8 ( const MQTTPropBuilder_t pPropertyBuilder,
size_t *  currentIndex,
uint8_t  propertyId,
const char **  property,
size_t *  propertyLength 
)
static

Get a UTF-8 string property value from the property builder.

This function extracts a UTF-8 string property value from the property builder at the specified index and validates that it matches the expected property ID.

Parameters
[in]pPropertyBuilderPointer to the property builder containing the properties.
[in,out]currentIndexPointer to the current index in the property buffer. Updated to point past the property on success.
[in]propertyIdExpected property ID to validate against.
[out]propertyPointer to store the extracted UTF-8 string pointer.
[out]propertyLengthPointer to store the length of the extracted string.
Returns
MQTTSuccess if the property is successfully extracted; MQTTBadParameter if parameters are invalid or property ID doesn't match.

◆ MQTT_GetNextPropertyType()

MQTTStatus_t MQTT_GetNextPropertyType ( const MQTTPropBuilder_t pPropertyBuilder,
const size_t *  currentIndex,
uint8_t *  property 
)

Get the property type at the current index in the property builder.

This function retrieves the property identifier byte at the specified index and validates that it is a recognized MQTT v5 property type. The index is not advanced by this function - use the appropriate MQTTPropGet_* function to retrieve the property value and advance the index.

Warning
When iterating through properties in a loop, every property returned by this function MUST be consumed by either calling the corresponding MQTTPropGet_* function or MQTT_SkipNextProperty. Failing to do so will leave the index unchanged, causing an infinite loop.
Parameters
[in]pPropertyBuilderProperty builder containing the properties.
[in]currentIndexCurrent index in the property builder buffer.
[out]propertyPointer to store the property type identifier.
Returns
MQTTSuccess if property type is retrieved and valid; MQTTBadParameter if invalid parameters are passed, index is out of bounds, or the property type is not recognized.

◆ MQTT_SkipNextProperty()

MQTTStatus_t MQTT_SkipNextProperty ( const MQTTPropBuilder_t pPropertyBuilder,
size_t *  currentIndex 
)

Skip the next property in the property builder without extracting its value.

This function advances the current index past the property at the current position in the property buffer. It validates the property ID and ensures the property data is within bounds, but does not extract or return the property value. This is useful for iterating through properties when only specific properties need to be extracted.

Warning
When iterating through properties with MQTT_GetNextPropertyType, you MUST call this function for any property you do not handle with a MQTTPropGet_* function. Without this, the index will not advance past the unhandled property, resulting in an infinite loop.
Parameters
[in]pPropertyBuilderPointer to the property builder containing the properties.
[in,out]currentIndexPointer to the current index in the property buffer. On success, updated to point to the next property.
Returns
MQTTSuccess if the property is successfully skipped; MQTTBadParameter if parameters are invalid, property ID is unknown, or the property data extends beyond the buffer bounds; MQTTEndOfProperties if currentIndex is already at or past the end of properties.

Example

// Variables used in this example.
MQTTStatus_t status;
MQTTPropBuilder_t propertyBuilder = { 0 };
size_t currentIndex = 0;
uint8_t propertyType;
// Initialize property builder with received properties
// (initialization details out of scope for this example)
initializePropertyBuilder( &propertyBuilder );
// Iterate through all properties
while( currentIndex < propertyBuilder.currentIndex )
{
// Get the property type at current position
status = MQTT_GetNextPropertyType( &propertyBuilder, &currentIndex, &propertyType );
if( status != MQTTSuccess )
{
break;
}
// Only extract user properties, skip all others
if( propertyType == MQTT_USER_PROPERTY_ID )
{
status = MQTTPropGet_UserProp( &propertyBuilder, &currentIndex, &userProp );
// Process user property...
}
else
{
// Skip this property
status = MQTT_SkipNextProperty( &propertyBuilder, &currentIndex );
}
if( status != MQTTSuccess )
{
break;
}
}
MQTTStatus_t MQTT_GetNextPropertyType(const MQTTPropBuilder_t *pPropertyBuilder, const size_t *currentIndex, uint8_t *property)
Get the property type at the current index in the property builder.
Definition: core_mqtt_prop_deserializer.c:386
MQTTStatus_t MQTT_SkipNextProperty(const MQTTPropBuilder_t *pPropertyBuilder, size_t *currentIndex)
Skip the next property in the property builder without extracting its value.
Definition: core_mqtt_prop_deserializer.c:448
#define MQTT_USER_PROPERTY_ID
User property id.
Definition: core_mqtt_serializer.h:118
MQTTStatus_t MQTTPropGet_UserProp(const MQTTPropBuilder_t *pPropertyBuilder, size_t *currentIndex, MQTTUserProperty_t *pUserProperty)
Get User Property from property builder.
Definition: core_mqtt_prop_deserializer.c:566
MQTTStatus_t
Return codes from MQTT functions.
Definition: core_mqtt_serializer.h:239
@ MQTTSuccess
Definition: core_mqtt_serializer.h:240
Property builder for MQTT packets.
Definition: core_mqtt_serializer.h:470
size_t currentIndex
Current position in the buffer where next property will be written.
Definition: core_mqtt_serializer.h:473
Struct to hold user property.
Definition: core_mqtt_serializer.h:702

◆ MQTTPropGet_UserProp()

MQTTStatus_t MQTTPropGet_UserProp ( const MQTTPropBuilder_t pPropertyBuilder,
size_t *  currentIndex,
MQTTUserProperty_t pUserProperty 
)

Get User Property from property builder.

Parameters
[in]pPropertyBuilderProperty builder to get property from.
[in,out]currentIndexCurrent index in the property builder buffer. Updated to next property on success.
[out]pUserPropertyPointer to store the user property key-value pair.
Returns
MQTTSuccess if property is retrieved successfully; MQTTBadParameter if invalid parameters are passed.

◆ MQTTPropGet_SessionExpiry()

MQTTStatus_t MQTTPropGet_SessionExpiry ( const MQTTPropBuilder_t pPropertyBuilder,
size_t *  currentIndex,
uint32_t *  pSessionExpiry 
)

Get Session Expiry Interval property from property builder.

Parameters
[in]pPropertyBuilderProperty builder to get property from.
[in,out]currentIndexCurrent index in the property builder buffer. Updated to next property on success.
[out]pSessionExpiryPointer to store the session expiry interval in seconds.
Returns
MQTTSuccess if property is retrieved successfully; MQTTBadParameter if invalid parameters are passed.

◆ MQTTPropGet_ReceiveMax()

MQTTStatus_t MQTTPropGet_ReceiveMax ( const MQTTPropBuilder_t pPropertyBuilder,
size_t *  currentIndex,
uint16_t *  pReceiveMax 
)

Get Receive Maximum property from property builder.

Parameters
[in]pPropertyBuilderProperty builder to get property from.
[in,out]currentIndexCurrent index in the property builder buffer. Updated to next property on success.
[out]pReceiveMaxPointer to store the receive maximum value.
Returns
MQTTSuccess if property is retrieved successfully; MQTTBadParameter if invalid parameters are passed.

◆ MQTTPropGet_MaxQos()

MQTTStatus_t MQTTPropGet_MaxQos ( const MQTTPropBuilder_t pPropertyBuilder,
size_t *  currentIndex,
uint8_t *  pMaxQos 
)

Get Maximum QoS property from property builder.

Parameters
[in]pPropertyBuilderProperty builder to get property from.
[in,out]currentIndexCurrent index in the property builder buffer. Updated to next property on success.
[out]pMaxQosPointer to store the maximum QoS level (0, 1, or 2).
Returns
MQTTSuccess if property is retrieved successfully; MQTTBadParameter if invalid parameters are passed.

◆ MQTTPropGet_RetainAvailable()

MQTTStatus_t MQTTPropGet_RetainAvailable ( const MQTTPropBuilder_t pPropertyBuilder,
size_t *  currentIndex,
uint8_t *  pRetainAvailable 
)

Get Retain Available property from property builder.

Parameters
[in]pPropertyBuilderProperty builder to get property from.
[in,out]currentIndexCurrent index in the property builder buffer. Updated to next property on success.
[out]pRetainAvailablePointer to store the retain available flag (0 or 1).
Returns
MQTTSuccess if property is retrieved successfully; MQTTBadParameter if invalid parameters are passed.

◆ MQTTPropGet_MaxPacketSize()

MQTTStatus_t MQTTPropGet_MaxPacketSize ( const MQTTPropBuilder_t pPropertyBuilder,
size_t *  currentIndex,
uint32_t *  pMaxPacketSize 
)

Get Maximum Packet Size property from property builder.

Parameters
[in]pPropertyBuilderProperty builder to get property from.
[in,out]currentIndexCurrent index in the property builder buffer. Updated to next property on success.
[out]pMaxPacketSizePointer to store the maximum packet size in bytes.
Returns
MQTTSuccess if property is retrieved successfully; MQTTBadParameter if invalid parameters are passed.

◆ MQTTPropGet_AssignedClientId()

MQTTStatus_t MQTTPropGet_AssignedClientId ( const MQTTPropBuilder_t pPropertyBuilder,
size_t *  currentIndex,
const char **  pClientId,
size_t *  pClientIdLength 
)

Get Assigned Client Identifier property from property builder.

Parameters
[in]pPropertyBuilderProperty builder to get property from.
[in,out]currentIndexCurrent index in the property builder buffer. Updated to next property on success.
[out]pClientIdPointer to store the assigned client identifier string.
[out]pClientIdLengthPointer to store the client identifier length.
Returns
MQTTSuccess if property is retrieved successfully; MQTTBadParameter if invalid parameters are passed.

◆ MQTTPropGet_TopicAliasMax()

MQTTStatus_t MQTTPropGet_TopicAliasMax ( const MQTTPropBuilder_t pPropertyBuilder,
size_t *  currentIndex,
uint16_t *  pTopicAliasMax 
)

Get Topic Alias Maximum property from property builder.

Parameters
[in]pPropertyBuilderProperty builder to get property from.
[in,out]currentIndexCurrent index in the property builder buffer. Updated to next property on success.
[out]pTopicAliasMaxPointer to store the topic alias maximum value.
Returns
MQTTSuccess if property is retrieved successfully; MQTTBadParameter if invalid parameters are passed.

◆ MQTTPropGet_ReasonString()

MQTTStatus_t MQTTPropGet_ReasonString ( const MQTTPropBuilder_t pPropertyBuilder,
size_t *  currentIndex,
const char **  pReasonString,
size_t *  pReasonStringLength 
)

Get Reason String property from property builder.

Parameters
[in]pPropertyBuilderProperty builder to get property from.
[in,out]currentIndexCurrent index in the property builder buffer. Updated to next property on success.
[out]pReasonStringPointer to store the reason string.
[out]pReasonStringLengthPointer to store the reason string length.
Returns
MQTTSuccess if property is retrieved successfully; MQTTBadParameter if invalid parameters are passed.

◆ MQTTPropGet_WildcardId()

MQTTStatus_t MQTTPropGet_WildcardId ( const MQTTPropBuilder_t pPropertyBuilder,
size_t *  currentIndex,
uint8_t *  pWildcardAvailable 
)

Get Wildcard Subscription Available property from property builder.

Parameters
[in]pPropertyBuilderProperty builder to get property from.
[in,out]currentIndexCurrent index in the property builder buffer. Updated to next property on success.
[out]pWildcardAvailablePointer to store the wildcard subscription available flag (0 or 1).
Returns
MQTTSuccess if property is retrieved successfully; MQTTBadParameter if invalid parameters are passed.

◆ MQTTPropGet_SubsIdAvailable()

MQTTStatus_t MQTTPropGet_SubsIdAvailable ( const MQTTPropBuilder_t pPropertyBuilder,
size_t *  currentIndex,
uint8_t *  pSubsIdAvailable 
)

Get Subscription Identifier Available property from property builder.

Parameters
[in]pPropertyBuilderProperty builder to get property from.
[in,out]currentIndexCurrent index in the property builder buffer. Updated to next property on success.
[out]pSubsIdAvailablePointer to store the subscription identifier available flag (0 or 1).
Returns
MQTTSuccess if property is retrieved successfully; MQTTBadParameter if invalid parameters are passed.

◆ MQTTPropGet_SharedSubAvailable()

MQTTStatus_t MQTTPropGet_SharedSubAvailable ( const MQTTPropBuilder_t pPropertyBuilder,
size_t *  currentIndex,
uint8_t *  pSharedSubAvailable 
)

Get Shared Subscription Available property from property builder.

Parameters
[in]pPropertyBuilderProperty builder to get property from.
[in,out]currentIndexCurrent index in the property builder buffer. Updated to next property on success.
[out]pSharedSubAvailablePointer to store the shared subscription available flag (0 or 1).
Returns
MQTTSuccess if property is retrieved successfully; MQTTBadParameter if invalid parameters are passed.

◆ MQTTPropGet_ServerKeepAlive()

MQTTStatus_t MQTTPropGet_ServerKeepAlive ( const MQTTPropBuilder_t pPropertyBuilder,
size_t *  currentIndex,
uint16_t *  pServerKeepAlive 
)

Get Server Keep Alive property from property builder.

Parameters
[in]pPropertyBuilderProperty builder to get property from.
[in,out]currentIndexCurrent index in the property builder buffer. Updated to next property on success.
[out]pServerKeepAlivePointer to store the server keep alive interval in seconds.
Returns
MQTTSuccess if property is retrieved successfully; MQTTBadParameter if invalid parameters are passed.

◆ MQTTPropGet_ResponseInfo()

MQTTStatus_t MQTTPropGet_ResponseInfo ( const MQTTPropBuilder_t pPropertyBuilder,
size_t *  currentIndex,
const char **  pResponseInfo,
size_t *  pResponseInfoLength 
)

Get Response Information property from property builder.

Parameters
[in]pPropertyBuilderProperty builder to get property from.
[in,out]currentIndexCurrent index in the property builder buffer. Updated to next property on success.
[out]pResponseInfoPointer to store the response information string.
[out]pResponseInfoLengthPointer to store the response information length.
Returns
MQTTSuccess if property is retrieved successfully; MQTTBadParameter if invalid parameters are passed.

◆ MQTTPropGet_ServerRef()

MQTTStatus_t MQTTPropGet_ServerRef ( const MQTTPropBuilder_t pPropertyBuilder,
size_t *  currentIndex,
const char **  pServerRef,
size_t *  pServerRefLength 
)

Get Server Reference property from property builder.

Parameters
[in]pPropertyBuilderProperty builder to get property from.
[in,out]currentIndexCurrent index in the property builder buffer. Updated to next property on success.
[out]pServerRefPointer to store the server reference string.
[out]pServerRefLengthPointer to store the server reference length.
Returns
MQTTSuccess if property is retrieved successfully; MQTTBadParameter if invalid parameters are passed.

◆ MQTTPropGet_AuthMethod()

MQTTStatus_t MQTTPropGet_AuthMethod ( const MQTTPropBuilder_t pPropertyBuilder,
size_t *  currentIndex,
const char **  pAuthMethod,
size_t *  pAuthMethodLen 
)

Get Authentication Method property from property builder.

Parameters
[in]pPropertyBuilderProperty builder to get property from.
[in,out]currentIndexCurrent index in the property builder buffer. Updated to next property on success.
[out]pAuthMethodPointer to store the authentication method string.
[out]pAuthMethodLenPointer to store the authentication method length.
Returns
MQTTSuccess if property is retrieved successfully; MQTTBadParameter if invalid parameters are passed.

◆ MQTTPropGet_AuthData()

MQTTStatus_t MQTTPropGet_AuthData ( const MQTTPropBuilder_t pPropertyBuilder,
size_t *  currentIndex,
const char **  pAuthData,
size_t *  pAuthDataLen 
)

Get Authentication Data property from property builder.

Parameters
[in]pPropertyBuilderProperty builder to get property from.
[in,out]currentIndexCurrent index in the property builder buffer. Updated to next property on success.
[out]pAuthDataPointer to store the authentication data.
[out]pAuthDataLenPointer to store the authentication data length.
Returns
MQTTSuccess if property is retrieved successfully; MQTTBadParameter if invalid parameters are passed.

◆ MQTTPropGet_PayloadFormatIndicator()

MQTTStatus_t MQTTPropGet_PayloadFormatIndicator ( const MQTTPropBuilder_t pPropertyBuilder,
size_t *  currentIndex,
uint8_t *  pPayloadFormat 
)

Get Payload Format Indicator property from property builder.

Parameters
[in]pPropertyBuilderProperty builder to get property from.
[in,out]currentIndexCurrent index in the property builder buffer. Updated to next property on success.
[out]pPayloadFormatPointer to store the payload format indicator (0=unspecified, 1=UTF-8).
Returns
MQTTSuccess if property is retrieved successfully; MQTTBadParameter if invalid parameters are passed.

◆ MQTTPropGet_MessageExpiryInterval()

MQTTStatus_t MQTTPropGet_MessageExpiryInterval ( const MQTTPropBuilder_t pPropertyBuilder,
size_t *  currentIndex,
uint32_t *  pMessageExpiry 
)

Get Message Expiry Interval property from property builder.

Parameters
[in]pPropertyBuilderProperty builder to get property from.
[in,out]currentIndexCurrent index in the property builder buffer. Updated to next property on success.
[out]pMessageExpiryPointer to store the message expiry interval in seconds.
Returns
MQTTSuccess if property is retrieved successfully; MQTTBadParameter if invalid parameters are passed.

◆ MQTTPropGet_TopicAlias()

MQTTStatus_t MQTTPropGet_TopicAlias ( const MQTTPropBuilder_t pPropertyBuilder,
size_t *  currentIndex,
uint16_t *  pTopicAlias 
)

Get Topic Alias property from property builder.

Parameters
[in]pPropertyBuilderProperty builder to get property from.
[in,out]currentIndexCurrent index in the property builder buffer. Updated to next property on success.
[out]pTopicAliasPointer to store the topic alias value.
Returns
MQTTSuccess if property is retrieved successfully; MQTTBadParameter if invalid parameters are passed.

◆ MQTTPropGet_ResponseTopic()

MQTTStatus_t MQTTPropGet_ResponseTopic ( const MQTTPropBuilder_t pPropertyBuilder,
size_t *  currentIndex,
const char **  pResponseTopic,
size_t *  pResponseTopicLength 
)

Get Response Topic property from property builder.

Parameters
[in]pPropertyBuilderProperty builder to get property from.
[in,out]currentIndexCurrent index in the property builder buffer. Updated to next property on success.
[out]pResponseTopicPointer to store the response topic string.
[out]pResponseTopicLengthPointer to store the response topic length.
Returns
MQTTSuccess if property is retrieved successfully; MQTTBadParameter if invalid parameters are passed.

◆ MQTTPropGet_CorrelationData()

MQTTStatus_t MQTTPropGet_CorrelationData ( const MQTTPropBuilder_t pPropertyBuilder,
size_t *  currentIndex,
const char **  pCorrelationData,
size_t *  pCorrelationDataLength 
)

Get Correlation Data property from property builder.

Parameters
[in]pPropertyBuilderProperty builder to get property from.
[in,out]currentIndexCurrent index in the property builder buffer. Updated to next property on success.
[out]pCorrelationDataPointer to store the correlation data.
[out]pCorrelationDataLengthPointer to store the correlation data length.
Returns
MQTTSuccess if property is retrieved successfully; MQTTBadParameter if invalid parameters are passed.

◆ MQTTPropGet_SubscriptionId()

MQTTStatus_t MQTTPropGet_SubscriptionId ( const MQTTPropBuilder_t pPropertyBuilder,
size_t *  currentIndex,
uint32_t *  pSubscriptionId 
)

Get Subscription Identifier property from property builder.

Parameters
[in]pPropertyBuilderProperty builder to get property from.
[in,out]currentIndexCurrent index in the property builder buffer. Updated to next property on success.
[out]pSubscriptionIdPointer to store the subscription identifier (variable byte integer).
Returns
MQTTSuccess if property is retrieved successfully; MQTTBadParameter if invalid parameters are passed.

◆ MQTTPropGet_ContentType()

MQTTStatus_t MQTTPropGet_ContentType ( const MQTTPropBuilder_t pPropertyBuilder,
size_t *  currentIndex,
const char **  pContentType,
size_t *  pContentTypeLength 
)

Get the Content Type property from the property builder.

This function extracts the Content Type property value from the property builder at the specified index. The Content Type property describes the content of the Application Message.

Parameters
[in]pPropertyBuilderPointer to the property builder containing the properties.
[in,out]currentIndexPointer to the current index in the property buffer. Updated to point past the property on success.
[out]pContentTypePointer to store the extracted Content Type string.
[out]pContentTypeLengthPointer to store the length of the Content Type string.
Returns
MQTTSuccess if the property is successfully extracted; MQTTBadParameter if parameters are invalid or property is not Content Type.