Cosmetic changes in the MQTT demo

- Fix warnings in the MQTT code.
- Update comments in the iot_config.h.
This commit is contained in:
Gaurav Aggarwal
2019-07-23 18:20:06 +00:00
parent 17b18c8b7e
commit 95f60318d5
6 changed files with 63 additions and 46 deletions

View File

@ -1105,7 +1105,10 @@ _mqttOperation_t * _IotMqtt_FindOperation( _mqttConnection_t * pMqttConnection,
IotTaskPoolError_t taskPoolStatus = IOT_TASKPOOL_SUCCESS;
_mqttOperation_t * pResult = NULL;
IotLink_t * pResultLink = NULL;
_operationMatchParam_t param = { .type = type, .pPacketIdentifier = pPacketIdentifier };
_operationMatchParam_t param = { 0 };
param.type = type;
param.pPacketIdentifier = pPacketIdentifier;
if( pPacketIdentifier != NULL )
{

View File

@ -406,12 +406,11 @@ void _IotMqtt_InvokeSubscriptionCallback( _mqttConnection_t * pMqttConnection,
void ( * callbackFunction )( void *,
IotMqttCallbackParam_t * ) = NULL;
_topicMatchParams_t topicMatchParams =
{
.pTopicName = pCallbackParam->u.message.info.pTopicName,
.topicNameLength = pCallbackParam->u.message.info.topicNameLength,
.exactMatchOnly = false
};
_topicMatchParams_t topicMatchParams = { 0 };
topicMatchParams.pTopicName = pCallbackParam->u.message.info.pTopicName;
topicMatchParams.topicNameLength = pCallbackParam->u.message.info.topicNameLength;
topicMatchParams.exactMatchOnly = false;
/* Prevent any other thread from modifying the subscription list while this
* function is searching. */
@ -508,11 +507,10 @@ void _IotMqtt_RemoveSubscriptionByPacket( _mqttConnection_t * pMqttConnection,
uint16_t packetIdentifier,
int32_t order )
{
const _packetMatchParams_t packetMatchParams =
{
.packetIdentifier = packetIdentifier,
.order = order
};
_packetMatchParams_t packetMatchParams = { 0 };
packetMatchParams.packetIdentifier = packetIdentifier;
packetMatchParams.order = order;
IotMutex_Lock( &( pMqttConnection->subscriptionMutex ) );
IotListDouble_RemoveAllMatches( &( pMqttConnection->subscriptionList ),
@ -593,12 +591,11 @@ bool IotMqtt_IsSubscribed( IotMqttConnection_t mqttConnection,
bool status = false;
_mqttSubscription_t * pSubscription = NULL;
IotLink_t * pSubscriptionLink = NULL;
_topicMatchParams_t topicMatchParams =
{
.pTopicName = pTopicFilter,
.topicNameLength = topicFilterLength,
.exactMatchOnly = true
};
_topicMatchParams_t topicMatchParams = { 0 };
topicMatchParams.pTopicName = pTopicFilter;
topicMatchParams.topicNameLength = topicFilterLength;
topicMatchParams.exactMatchOnly = false;
/* Prevent any other thread from modifying the subscription list while this
* function is running. */