<?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>Warning passing data to mqttsn_client_publish</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/74508/warning-passing-data-to-mqttsn_client_publish</link><description>Hello, 
 Starting with the example of mqtt_sn_client_publisher in the nRF5 SDK for Thread and Zigbee and I want to publish an array of data like this one 
 
 in a MQTT topic. For doing so, I`m using the function which is used in the example: 
 
 using</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 27 Apr 2021 20:34:37 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/74508/warning-passing-data-to-mqttsn_client_publish" /><item><title>RE: Warning passing data to mqttsn_client_publish</title><link>https://devzone.nordicsemi.com/thread/307106?ContentTypeID=1</link><pubDate>Tue, 27 Apr 2021 20:34:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9aa5161a-cfdc-4448-8379-5c793b57b60b</guid><dc:creator>amorenza</dc:creator><description>&lt;p&gt;The warning pointed to the third argument of the function which should be:&amp;nbsp;&lt;pre class="ui-code" data-mode="text"&gt;/**@brief Publishes data to given topic.  
 *
 * @param[inout] p_client       Pointer to initialized and connected client.
 * @param[in]    topic_id       Value of previously registered topic ID. 
 * @param[in]    p_payload      Data to be published.
 * @param[in]    payload_len    Length of data to be published.
 * @param[out]   msg_id         (optional) Pointer to message ID assigned to the message by client. 
 *
 * @return       NRF_SUCCESS if the publish request has been sent successfully.
 *               Otherwise error code is returned.
 */
uint32_t mqttsn_client_publish(mqttsn_client_t * p_client,
                               uint16_t          topic_id,
                               const uint8_t   * p_payload,
                               uint16_t          payload_len,
                               uint16_t        * msg_id);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Deleting the &amp;amp; did the trick and the warning is disabled now.&lt;/p&gt;
&lt;p&gt;Thank you!!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Warning passing data to mqttsn_client_publish</title><link>https://devzone.nordicsemi.com/thread/307105?ContentTypeID=1</link><pubDate>Tue, 27 Apr 2021 20:07:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:797abbff-ec82-4056-8c02-3928deb2ee83</guid><dc:creator>awneil</dc:creator><description>[quote userid="103451" url="~/f/nordic-q-a/74508/warning-passing-data-to-mqttsn_client_publish"]&lt;p&gt;The code compiles but in the line where I call the function, segger shows a warning about incompatible pointer types.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;[/quote]
&lt;p&gt;Post the complete text of the message - it usually includes a description of which parameter it&amp;#39;s talking about, and why it thinks them &amp;quot;incompatible&amp;quot;&lt;/p&gt;
&lt;p&gt;Remember that an array name in C is, effectively, a pointer to the 1st element - so you don&amp;#39;t need the &amp;amp;.&lt;/p&gt;
&lt;p&gt;If you do use the &amp;amp;, it should be &amp;amp;readInfo[0]&lt;/p&gt;
&lt;p&gt;&lt;a href="http://c-faq.com/aryptr/index.html"&gt;http://c-faq.com/aryptr/index.html&lt;/a&gt;&amp;nbsp;- in particualr,&amp;nbsp;&lt;a href="http://c-faq.com/aryptr/aryptrequiv.html"&gt;c-faq.com/.../aryptrequiv.html&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>