Skip to content

Commit

Permalink
MQTTv5
Browse files Browse the repository at this point in the history
  • Loading branch information
Pooja-Toshniwal committed Jul 18, 2024
1 parent 5d0ac4b commit e2de0bd
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion source/core_mqtt.c
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,7 @@ static bool matchTopicFilter( const char * pTopicName,
*
* @param[in] pContext MQTT Connection context.
* @param[in] pAckInfo Reason code and properties.
* @param[in] remainingLength Remaining lenght of the packet.
* @param[in] remainingLength Remaining length of the packet.
* @param[in] sessionExpiry Session expiry interval.
*
*
Expand Down
22 changes: 11 additions & 11 deletions source/core_mqtt_serializer.c
Original file line number Diff line number Diff line change
Expand Up @@ -1178,7 +1178,7 @@ static MQTTStatus_t deserializePingresp( const MQTTPacketInfo_t * pPingresp );
* @param[in] pFixedBuffer Buffer for packet serialization.
*
*/
static void seriailizePubAckPacketV5( const MQTTAckInfo_t * pAckInfo,
static void serializePubAckPacketV5( const MQTTAckInfo_t * pAckInfo,
uint8_t packetType,
uint16_t packetId,
size_t remainingLength,
Expand Down Expand Up @@ -1213,7 +1213,7 @@ static MQTTStatus_t deserializePingresp( const MQTTPacketInfo_t * pPingresp );
*
* @param[out] pAckInfo To store the decoded property.
* @param[out] pIndex Pointer to the current index of the buffer.
* @param[out] remainingLength Reamining length of the incoming packet.
* @param[out] remainingLength Remaining length of the incoming packet.
*
*
* @return #MQTTSuccess, #MQTTProtocolError and #MQTTMalformedPacket
Expand Down Expand Up @@ -1260,7 +1260,7 @@ static MQTTStatus_t deserializePingresp( const MQTTPacketInfo_t * pPingresp );
* @param[in] sessionExpiry Session Expiry Interval.
*
*/
static void seriailizeDisconnectPacketV5( const MQTTAckInfo_t * pDisconnectInfo,
static void serializeDisconnectPacketV5( const MQTTAckInfo_t * pDisconnectInfo,
const MQTTFixedBuffer_t * pFixedBuffer,
size_t remainingLength,
uint32_t sessionExpiry );
Expand Down Expand Up @@ -2392,7 +2392,7 @@ static MQTTStatus_t deserializePingresp( const MQTTPacketInfo_t * pPingresp );
return status;
}

static void seriailizePubAckPacketV5( const MQTTAckInfo_t * pAckInfo,
static void serializePubAckPacketV5( const MQTTAckInfo_t * pAckInfo,
uint8_t packetType,
uint16_t packetId,
size_t remainingLength,
Expand Down Expand Up @@ -2556,7 +2556,7 @@ static MQTTStatus_t deserializePingresp( const MQTTPacketInfo_t * pPingresp );
{
while( ( propertyLength > 0U ) && ( status == MQTTSuccess ) )
{
/*Decode the poperty id.*/
/*Decode the property id.*/
uint8_t packetId = *pLocalIndex;
bool reasonString = false;
pLocalIndex = &pLocalIndex[ 1 ];
Expand Down Expand Up @@ -5186,7 +5186,7 @@ MQTTStatus_t MQTT_ProcessIncomingPacketTypeAndLength( const uint8_t * pBuffer,
pIndexLocal = &pIndexLocal[ 4 ];
}

/*Serialze the topic alias if provided*/
/*Serialize the topic alias if provided*/

if( pPublishInfo->topicAlias != 0U )
{
Expand Down Expand Up @@ -5441,7 +5441,7 @@ MQTTStatus_t MQTT_ProcessIncomingPacketTypeAndLength( const uint8_t * pBuffer,
}
else if( ( pPublishInfo->retain == true ) && ( retainAvailable == 0U ) )
{
LogError( ( "Retain is not avaialble." ) );
LogError( ( "Retain is not available." ) );
status = MQTTBadParameter;
}
else if( ( pPublishInfo->qos != MQTTQoS0 ) && ( maxQos == 0U ) )
Expand Down Expand Up @@ -5721,7 +5721,7 @@ MQTTStatus_t MQTT_ProcessIncomingPacketTypeAndLength( const uint8_t * pBuffer,
}
else
{
seriailizePubAckPacketV5( pAckInfo, packetType, packetId, remainingLength, pFixedBuffer );
serializePubAckPacketV5( pAckInfo, packetType, packetId, remainingLength, pFixedBuffer );
}
}

Expand Down Expand Up @@ -5868,7 +5868,7 @@ MQTTStatus_t MQTT_ProcessIncomingPacketTypeAndLength( const uint8_t * pBuffer,
return pIndexLocal;
}

static void seriailizeDisconnectPacketV5( const MQTTAckInfo_t * pDisconnectInfo,
static void serializeDisconnectPacketV5( const MQTTAckInfo_t * pDisconnectInfo,
const MQTTFixedBuffer_t * pFixedBuffer,
size_t remainingLength,
uint32_t sessionExpiry )
Expand Down Expand Up @@ -5954,7 +5954,7 @@ MQTTStatus_t MQTT_ProcessIncomingPacketTypeAndLength( const uint8_t * pBuffer,
}
else
{
seriailizeDisconnectPacketV5( pDisconnectInfo, pFixedBuffer, remainingLength, sessionExpiry );
serializeDisconnectPacketV5( pDisconnectInfo, pFixedBuffer, remainingLength, sessionExpiry );
}
}

Expand Down Expand Up @@ -6034,7 +6034,7 @@ MQTTStatus_t MQTT_ProcessIncomingPacketTypeAndLength( const uint8_t * pBuffer,
{
while( ( propertyLength > 0U ) && ( status == MQTTSuccess ) )
{
/*Decode the poperty id.*/
/*Decode the property id.*/
uint8_t propertyId = *pIndex;
bool reasonString = false;
bool serverRef = false;
Expand Down
8 changes: 4 additions & 4 deletions source/include/core_mqtt_serializer.h
Original file line number Diff line number Diff line change
Expand Up @@ -1855,7 +1855,7 @@ MQTTStatus_t MQTTV5_SerializeConnect(const MQTTConnectInfo_t* pConnectInfo,
* //Set the publish info parameters.
*
* //Validate the publish packet
* status = MQTTV5_ValidatePublishParams(&ublishInfo,topicAliasMax,retainAvailable,maxQos);
* status = MQTTV5_ValidatePublishParams(&publishInfo,topicAliasMax,retainAvailable,maxQos);
*
* if( status == MQTTSuccess )
* {
Expand Down Expand Up @@ -2007,9 +2007,9 @@ MQTTStatus_t MQTTV5_DeserializeAck( const MQTTPacketInfo_t * pIncomingPacket,
* }
* @endcode
*/
/* @[declare_mqttv5_getdackpacketsize] */
/* @[declare_mqttv5_getackpacketsize] */
MQTTStatus_t MQTTV5_GetAckPacketSize( MQTTAckInfo_t *pAckInfo, size_t* pRemainingLength,size_t * pPacketSize, uint32_t maxPacketSize);
/* @[declare_mqttv5_getdackpacketsize] */
/* @[declare_mqttv5_getackpacketsize] */

/**
* @fn uint8_t * MQTTV5_SerializeAckFixed(uint8_t * pIndex,
Expand Down Expand Up @@ -2272,7 +2272,7 @@ uint8_t * MQTTV5_SerializeDisconnectFixed(uint8_t * pIndex,
*
* // Serialize the disconnect into the fixed buffer.
* MQTTV5_SerializeDisconnectWithProperty( &disconnectInfo,
remainingLenght,
remainingLength,
&fixedBuffer,
sessionExpiry);
*
Expand Down
4 changes: 2 additions & 2 deletions test/unit-test/MQTTv5/core_mqttv5_serializer_utest.c
Original file line number Diff line number Diff line change
Expand Up @@ -2444,7 +2444,7 @@ void test_MQTTV5_SerializeConnect_Happy_Paths()
verifySerializedConnectPacket( &connectInfo, &publishInfo, &properties,
remainingLength, &networkBuffer );

/* Repeat with NULL ppublishInfo. */
/* Repeat with NULL publishInfo. */
mqttStatus = MQTTV5_GetConnectPacketSize( &connectInfo,
NULL,
&properties,
Expand Down Expand Up @@ -2753,7 +2753,7 @@ void test_MQTTV5_DeserializeAck_puback( void )
TEST_ASSERT_EQUAL_INT( MQTTProtocolError, status );

requestProblem = true;
/*User properties not initilaized.*/
/*User properties not initialized.*/
status = MQTTV5_DeserializeAck( &mqttPacketInfo, &packetIdentifier, &ackInfo, requestProblem, maxPacketSize );
TEST_ASSERT_EQUAL_INT( MQTTBadParameter, status );

Expand Down

0 comments on commit e2de0bd

Please sign in to comment.