mirror of
https://github.com/FreeRTOS/FreeRTOS.git
synced 2025-06-26 19:49:04 +08:00
Cosmetic changes in the MQTT demo
- Fix warnings in the MQTT code. - Update comments in the iot_config.h.
This commit is contained in:
@ -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 )
|
||||
{
|
||||
|
@ -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. */
|
||||
|
Reference in New Issue
Block a user