<?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>cJSON in Mesh SDK?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/71209/cjson-in-mesh-sdk</link><description>Hi all, 
 I have some issues to print and parse JSON file using cJSON features. My code works without problems in SDK, but when I try the same code in Mesh part, I am not able to print and parse the file. It seems that file is to big, because when I remove</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 05 Feb 2021 16:05:57 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/71209/cjson-in-mesh-sdk" /><item><title>RE: cJSON in Mesh SDK?</title><link>https://devzone.nordicsemi.com/thread/293163?ContentTypeID=1</link><pubDate>Fri, 05 Feb 2021 16:05:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3e7d49b6-6b9a-41cb-bb1b-39bc81fc6bdb</guid><dc:creator>Aduka_27</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I increased the runtime memory area (&lt;strong&gt;heap size&lt;/strong&gt;) and now it works without problems...I can print and parse the full JSON. Is this the way that you told me to try, or maybe I need to change the ram and flash somewhere else...if it is not the case, then my problem is solved!&lt;/p&gt;
&lt;p&gt;Thank you very much for the help!&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Adnan.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: cJSON in Mesh SDK?</title><link>https://devzone.nordicsemi.com/thread/293124?ContentTypeID=1</link><pubDate>Fri, 05 Feb 2021 14:00:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:938921e1-1e86-4098-a127-554f495523b0</guid><dc:creator>Mttrinh</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I&amp;#39;m not sure what the issue is here, but you might need to increase the ram and flash. Can you try this and see if it makes any difference?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: cJSON in Mesh SDK?</title><link>https://devzone.nordicsemi.com/thread/292961?ContentTypeID=1</link><pubDate>Thu, 04 Feb 2021 15:05:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c308a1d8-48a2-48e8-b495-e351bc5479d0</guid><dc:creator>Aduka_27</dc:creator><description>&lt;p&gt;Hi Mttrinh,&lt;/p&gt;
&lt;p&gt;Well, I do not get any kind of error...I use the same code for printing out JSON file in SDK and Mesh SDK. In SDK, it works without problems and I can see the output, but when I move to Mesh SDK I am not able to see the output...when I remove one part of the code and make the JSON quite shorter it works also in Mesh SDK. What can be the possible issue there? Can you suggest me how to fix it?&lt;/p&gt;
&lt;p&gt;Also, I send you my code with outputs for both SDKs.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Code:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#include &amp;lt;stdbool.h&amp;gt;
#include &amp;lt;stdint.h&amp;gt;
#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;stdlib.h&amp;gt;
//#include &amp;quot;nrf_delay.h&amp;quot;
//#include &amp;quot;boards.h&amp;quot;

#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;stdlib.h&amp;gt;
#include &amp;quot;cJSON.h&amp;quot;

char *create_JSON(){

    char *out;
    cJSON *root, *cars, *car;

    /* create root node and array */
    root = cJSON_CreateObject();
    cars = cJSON_CreateArray();

    /* add cars array to root */
    cJSON_AddItemToObject(root, &amp;quot;cars&amp;quot;, cars);

    /* add 1st car to cars array */
    cJSON_AddItemToArray(cars, car = cJSON_CreateObject());
    cJSON_AddItemToObject(car, &amp;quot;CarType1&amp;quot;, cJSON_CreateString(&amp;quot;BMW&amp;quot;));
    cJSON_AddItemToObject(car, &amp;quot;carID1&amp;quot;, cJSON_CreateString(&amp;quot;bmw123&amp;quot;));

    /* add 2nd car to cars array */
    cJSON_AddItemToArray(cars, car = cJSON_CreateObject());
    cJSON_AddItemToObject(car, &amp;quot;CarType2&amp;quot;, cJSON_CreateString(&amp;quot;mercedes&amp;quot;));
    cJSON_AddItemToObject(car, &amp;quot;carID2&amp;quot;, cJSON_CreateString(&amp;quot;mercedes123&amp;quot;));

    cJSON_AddItemToArray(cars, car = cJSON_CreateObject());
    cJSON_AddItemToObject(car, &amp;quot;CarType&amp;quot;, cJSON_CreateString(&amp;quot;VW&amp;quot;));
    cJSON_AddItemToObject(car, &amp;quot;carID&amp;quot;, cJSON_CreateString(&amp;quot;vw123&amp;quot;));

    /* print everything */
    out = cJSON_Print(root);

    /* free all objects under root and root itself */
    cJSON_Delete(root);

    return out;
}

int main(){

    char *out = create_JSON();
    printf(&amp;quot;%s\n&amp;quot;, out);
    free(out);
    return 0;
}







&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;SDK output:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;{
	&amp;quot;cars&amp;quot;:	[{
			&amp;quot;CarType1&amp;quot;:	&amp;quot;BMW&amp;quot;,
			&amp;quot;carID1&amp;quot;:	&amp;quot;bmw123&amp;quot;
		}, {
			&amp;quot;CarType2&amp;quot;:	&amp;quot;mercedes&amp;quot;,
			&amp;quot;carID2&amp;quot;:	&amp;quot;mercedes123&amp;quot;
		}, {
			&amp;quot;CarType&amp;quot;:	&amp;quot;VW&amp;quot;,
			&amp;quot;carID&amp;quot;:	&amp;quot;vw123&amp;quot;
		}]
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Mesh SDK output:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/meshsdkoutput.png" /&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;But as I mentioned before, when I comment one part of the code (in this case VW part), this is the output in Mesh SDK:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;strong&gt;&lt;pre class="ui-code" data-mode="text"&gt;{
	&amp;quot;cars&amp;quot;:	[{
			&amp;quot;CarType&amp;quot;:	&amp;quot;BMW&amp;quot;,
			&amp;quot;carID&amp;quot;:	&amp;quot;bmw123&amp;quot;
		}, {
			&amp;quot;CarType&amp;quot;:	&amp;quot;mercedes&amp;quot;,
			&amp;quot;carID&amp;quot;:	&amp;quot;mercedes123&amp;quot;
		}]
}&lt;/pre&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/meshsdk.png" /&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I hope that I provided you a bit more information about my problem.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Adnan.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: cJSON in Mesh SDK?</title><link>https://devzone.nordicsemi.com/thread/292907?ContentTypeID=1</link><pubDate>Thu, 04 Feb 2021 12:52:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:95978d34-6aab-4c0d-b89f-4ef86e8d4317</guid><dc:creator>Mttrinh</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Could you provide more details regarding the issue? Do you get any kind of error? How does it fail? Any kind of logs will also be helpful.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>