Skip to content

Fix: change subscription QoS to 1 in mqtt_demo_basic_tls demo for AWS IoT Core compatibility #1941

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions demos/mqtt/mqtt_demo_basic_tls/mqtt_demo_basic_tls.c
Original file line number Diff line number Diff line change
Expand Up @@ -1093,7 +1093,8 @@ static int subscribeToTopic( MQTTContext_t * pMqttContext )
( void ) memset( ( void * ) pGlobalSubscriptionList, 0x00, sizeof( pGlobalSubscriptionList ) );

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

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

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

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