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 <duy.nguyen.xa@renesas.com>
This commit is contained in:
Duy Nguyen 2024-11-21 14:35:47 +07:00 committed by Benjamin Cabé
commit 689d1f2ca9

View file

@ -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;