summaryrefslogtreecommitdiff
path: root/FreeRTOS-Plus/Source/FreeRTOS-IoT-Libraries/c_sdk/standard/mqtt/src/iot_mqtt_subscription.c
diff options
context:
space:
mode:
Diffstat (limited to 'FreeRTOS-Plus/Source/FreeRTOS-IoT-Libraries/c_sdk/standard/mqtt/src/iot_mqtt_subscription.c')
-rw-r--r--FreeRTOS-Plus/Source/FreeRTOS-IoT-Libraries/c_sdk/standard/mqtt/src/iot_mqtt_subscription.c31
1 files changed, 14 insertions, 17 deletions
diff --git a/FreeRTOS-Plus/Source/FreeRTOS-IoT-Libraries/c_sdk/standard/mqtt/src/iot_mqtt_subscription.c b/FreeRTOS-Plus/Source/FreeRTOS-IoT-Libraries/c_sdk/standard/mqtt/src/iot_mqtt_subscription.c
index 99664de05..59caccc7f 100644
--- a/FreeRTOS-Plus/Source/FreeRTOS-IoT-Libraries/c_sdk/standard/mqtt/src/iot_mqtt_subscription.c
+++ b/FreeRTOS-Plus/Source/FreeRTOS-IoT-Libraries/c_sdk/standard/mqtt/src/iot_mqtt_subscription.c
@@ -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. */