<?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>Azure direct method text mangling</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/113191/azure-direct-method-text-mangling</link><description>Hi, 
 I&amp;#39;m using a Azure IoT Hub to connect some devices to the cloud and then uses the Direct Method to send messages to the devices. I can send messages and receive the response from a device through the hub, however the response text is somehow getting</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 15 Aug 2024 11:00:29 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/113191/azure-direct-method-text-mangling" /><item><title>RE: Azure direct method text mangling</title><link>https://devzone.nordicsemi.com/thread/498435?ContentTypeID=1</link><pubDate>Thu, 15 Aug 2024 11:00:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e18c7a19-414a-4dbe-b4ea-0689f4f297ad</guid><dc:creator>NilsDR</dc:creator><description>&lt;p&gt;The issue was resolved on StackOverflow&amp;nbsp;&lt;a href="https://stackoverflow.com/questions/78861902/char-vs-stdstring-data"&gt;stackoverflow.com/.../char-vs-stdstring-data&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Azure direct method text mangling</title><link>https://devzone.nordicsemi.com/thread/497825?ContentTypeID=1</link><pubDate>Mon, 12 Aug 2024 12:48:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6f70f2b8-c4ae-46be-92ca-8ec05a205042</guid><dc:creator>NilsDR</dc:creator><description>&lt;p&gt;The problem is that the type needs to a char* and not a const char* as it is defined by the azure_iot_hub.h library.&lt;br /&gt;Looking at this problem again I realized that the &amp;quot;test2&amp;quot; variable is allocated on the stack as it is defined at compile time while the &amp;quot;test&amp;quot; variable is allocated in ram as it is defined at runtime. Perhaps this could cause any problems I don&amp;#39;t see?&lt;/p&gt;
&lt;p&gt;I also posted this on StackOverflow:&amp;nbsp;&lt;a href="https://stackoverflow.com/questions/78861902/char-vs-stdstring-data"&gt;stackoverflow.com/.../char-vs-stdstring-data&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Azure direct method text mangling</title><link>https://devzone.nordicsemi.com/thread/495278?ContentTypeID=1</link><pubDate>Tue, 23 Jul 2024 16:45:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:df06428d-4e14-4a69-9c95-8d8b3464f1c1</guid><dc:creator>dejans</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;&lt;br /&gt;You could try to use c_str() as mentioned in this&amp;nbsp;&lt;a href="https://stackoverflow.com/questions/7416445/what-is-the-use-of-the-c-str-function"&gt;discussion&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Dejan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Azure direct method text mangling</title><link>https://devzone.nordicsemi.com/thread/494889?ContentTypeID=1</link><pubDate>Fri, 19 Jul 2024 19:34:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0e1d0e74-0c8e-45b6-93e6-b29fceb54835</guid><dc:creator>Michal</dc:creator><description>&lt;p&gt;By the way, considering that it is not completely an bug/issue with the library, but a more general C/C++ question, maybe you may want to ask on something like Stack Overflow as well about char* and C++?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Michal&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Azure direct method text mangling</title><link>https://devzone.nordicsemi.com/thread/494664?ContentTypeID=1</link><pubDate>Thu, 18 Jul 2024 21:13:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:73fe4f75-3a07-42ef-b0dd-e8de1789965b</guid><dc:creator>Michal</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I will check out what can be done here and I&amp;#39;ll get back to you.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Michal&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>