<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>MQTT Disconnect Reason Code</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/115382/mqtt-disconnect-reason-code</link><description>Hello, 
 I would like to send a reason code when disconnecting the client (nRF9160DK) and server in MQTT. How can I do this? 
 It seems that there is no argument to specify a reason code in the AT#XMQTTCON command or the mqtt_disconnect() function. 
</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 15 Oct 2024 08:57:32 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/115382/mqtt-disconnect-reason-code" /><item><title>RE: MQTT Disconnect Reason Code</title><link>https://devzone.nordicsemi.com/thread/506252?ContentTypeID=1</link><pubDate>Tue, 15 Oct 2024 08:57:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8f4d895e-6643-48e4-bb70-5eb982cc8fec</guid><dc:creator>Hakon</dc:creator><description>&lt;p&gt;&lt;span&gt;&lt;span dir="ltr"&gt;My understanding is that WILL message is NOT triggered by intentional MQTT disconnecting. Instead, broker will send the will of the client (obtained when connecting broker) in the case of below (MQTT 3.1.1).&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span dir="ltr"&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1728982548227v1.png" alt=" " /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span dir="ltr"&gt;Zephyr MQTT API does not have reason code, because it&amp;#39;s based on MQTT 3.1.1, and the feature is not available until MQTT 5.0.0.&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MQTT Disconnect Reason Code</title><link>https://devzone.nordicsemi.com/thread/506152?ContentTypeID=1</link><pubDate>Mon, 14 Oct 2024 13:30:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3fc0b879-021b-4c69-8b18-ade8a5ce8f2d</guid><dc:creator>Hakon</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I have asked about this internally.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>