Skip to content

Commit 09a3acf

Browse files
author
100ask
committed
Fix: change default subscription QoS from 2 to 1 in mqtt_demo_basic_tls demo
1 parent d39ba5d commit 09a3acf

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

demos/mqtt/mqtt_demo_basic_tls/mqtt_demo_basic_tls.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1093,7 +1093,8 @@ static int subscribeToTopic( MQTTContext_t * pMqttContext )
10931093
( void ) memset( ( void * ) pGlobalSubscriptionList, 0x00, sizeof( pGlobalSubscriptionList ) );
10941094

10951095
/* This example subscribes to only one topic and uses QOS2. */
1096-
pGlobalSubscriptionList[ 0 ].qos = MQTTQoS2;
1096+
/* AWS IoT Core does not support QoS2. Use QoS1 instead to avoid SSL_read failure. */
1097+
pGlobalSubscriptionList[ 0 ].qos = MQTTQoS1;
10971098
pGlobalSubscriptionList[ 0 ].pTopicFilter = MQTT_EXAMPLE_TOPIC;
10981099
pGlobalSubscriptionList[ 0 ].topicFilterLength = MQTT_EXAMPLE_TOPIC_LENGTH;
10991100

@@ -1135,8 +1136,9 @@ static int unsubscribeFromTopic( MQTTContext_t * pMqttContext )
11351136
( void ) memset( ( void * ) pGlobalSubscriptionList, 0x00, sizeof( pGlobalSubscriptionList ) );
11361137

11371138
/* This example subscribes to and unsubscribes from only one topic
1138-
* and uses QOS2. */
1139-
pGlobalSubscriptionList[ 0 ].qos = MQTTQoS2;
1139+
* and uses QOS2. */
1140+
/* AWS IoT Core does not support QoS2. Use QoS1 instead to avoid SSL_read failure. */
1141+
pGlobalSubscriptionList[ 0 ].qos = MQTTQoS1;
11401142
pGlobalSubscriptionList[ 0 ].pTopicFilter = MQTT_EXAMPLE_TOPIC;
11411143
pGlobalSubscriptionList[ 0 ].topicFilterLength = MQTT_EXAMPLE_TOPIC_LENGTH;
11421144

@@ -1188,7 +1190,8 @@ static int publishToTopic( MQTTContext_t * pMqttContext )
11881190
else
11891191
{
11901192
/* This example publishes to only one topic and uses QOS2. */
1191-
outgoingPublishPackets[ publishIndex ].pubInfo.qos = MQTTQoS2;
1193+
/* AWS IoT Core does not support QoS2. Use QoS1 instead to avoid SSL_read failure. */
1194+
outgoingPublishPackets[ publishIndex ].pubInfo.qos = MQTTQoS1;
11921195
outgoingPublishPackets[ publishIndex ].pubInfo.pTopicName = MQTT_EXAMPLE_TOPIC;
11931196
outgoingPublishPackets[ publishIndex ].pubInfo.topicNameLength = MQTT_EXAMPLE_TOPIC_LENGTH;
11941197
outgoingPublishPackets[ publishIndex ].pubInfo.pPayload = MQTT_EXAMPLE_MESSAGE;

0 commit comments

Comments
 (0)