Skip to content

Commit

Permalink
sample: net: Add initialize for dup_flag when publish
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
duynguyenxa authored and kartben committed Dec 5, 2024
1 parent 68a9208 commit 689d1f2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions samples/net/cloud/aws_iot_mqtt/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ static int publish_message(const char *topic, size_t topic_len, uint8_t *payload
struct mqtt_publish_param msg;

msg.retain_flag = 0u;
msg.dup_flag = 0u;
msg.message.topic.topic.utf8 = topic;
msg.message.topic.topic.size = topic_len;
msg.message.topic.qos = CONFIG_AWS_QOS;
Expand Down

0 comments on commit 689d1f2

Please sign in to comment.