Skip to content

Commit 689d1f2

Browse files
duynguyenxakartben
authored andcommitted
sample: net: Add initialize for dup_flag when publish
When publish message, the dup_flag is not intialize causing it to have random value and making the AWS MQTT broker to reject the message Add initialize dup_flag as 0 Signed-off-by: Duy Nguyen <[email protected]>
1 parent 68a9208 commit 689d1f2

File tree

1 file changed

+1
-0
lines changed
  • samples/net/cloud/aws_iot_mqtt/src

1 file changed

+1
-0
lines changed

samples/net/cloud/aws_iot_mqtt/src/main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ static int publish_message(const char *topic, size_t topic_len, uint8_t *payload
126126
struct mqtt_publish_param msg;
127127

128128
msg.retain_flag = 0u;
129+
msg.dup_flag = 0u;
129130
msg.message.topic.topic.utf8 = topic;
130131
msg.message.topic.topic.size = topic_len;
131132
msg.message.topic.qos = CONFIG_AWS_QOS;

0 commit comments

Comments
 (0)