1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2<html xmlns="http://www.w3.org/1999/xhtml">
3<head>
4<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
5<meta http-equiv="X-UA-Compatible" content="IE=9"/>
6<meta name="generator" content="Doxygen 1.8.13"/>
7<meta name="viewport" content="width=device-width, initial-scale=1"/>
8<title>ISSDK: drivers/host/data_format_json.h File Reference</title>
9<link href="tabs.css" rel="stylesheet" type="text/css"/>
10<script type="text/javascript" src="jquery.js"></script>
11<script type="text/javascript" src="dynsections.js"></script>
12<link href="issdk_stylesheet.css" rel="stylesheet" type="text/css" />
13</head>
14<body>
15<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
16<div id="titlearea">
17<table cellspacing="0" cellpadding="0">
18 <tbody>
19 <tr style="height: 56px;">
20  <td id="projectlogo"><img alt="Logo" src="nxp_logo_small.png"/></td>
21  <td id="projectalign" style="padding-left: 0.5em;">
22   <div id="projectname">ISSDK
23   &#160;<span id="projectnumber">1.8</span>
24   </div>
25   <div id="projectbrief">IoT Sensing Software Development Kit</div>
26  </td>
27 </tr>
28 </tbody>
29</table>
30</div>
31<!-- end header part -->
32<!-- Generated by Doxygen 1.8.13 -->
33<script type="text/javascript" src="menudata.js"></script>
34<script type="text/javascript" src="menu.js"></script>
35<script type="text/javascript">
36$(function() {
37  initMenu('',false,false,'search.php','Search');
38});
39</script>
40<div id="main-nav"></div>
41<div id="nav-path" class="navpath">
42  <ul>
43<li class="navelem"><a class="el" href="dir_14bc92f4b96c8519b376567118ac28b3.html">drivers</a></li><li class="navelem"><a class="el" href="dir_32464e4af507982e116bd625f186503f.html">host</a></li>  </ul>
44</div>
45</div><!-- top -->
46<div class="header">
47  <div class="summary">
48<a href="#define-members">Macros</a> &#124;
49<a href="#typedef-members">Typedefs</a> &#124;
50<a href="#enum-members">Enumerations</a> &#124;
51<a href="#func-members">Functions</a>  </div>
52  <div class="headertitle">
53<div class="title">data_format_json.h File Reference</div>  </div>
54</div><!--header-->
55<div class="contents">
56
57<p>The format_json.h file describes the structures and definitions for the data-format standard JSON.
58<a href="#details">More...</a></p>
59<div class="textblock"><code>#include &lt;stddef.h&gt;</code><br />
60<code>#include &lt;stdint.h&gt;</code><br />
61<code>#include &lt;stdbool.h&gt;</code><br />
62<code>#include &quot;<a class="el" href="a00527_source.html">host_interface_service.h</a>&quot;</code><br />
63<code>#include &quot;<a class="el" href="a00101_source.html">host_io_uart.h</a>&quot;</code><br />
64</div><div class="textblock"><div class="dynheader">
65Include dependency graph for data_format_json.h:</div>
66<div class="dyncontent">
67<div class="center"><img src="a00519.png" border="0" usemap="#drivers_2host_2data__format__json_8h" alt=""/></div>
68<map name="drivers_2host_2data__format__json_8h" id="drivers_2host_2data__format__json_8h">
69<area shape="rect" id="node5" href="a00527.html" title="The host_interface_service.h file describes the structures and definitions for the host..." alt="" coords="115,95,276,121"/>
70<area shape="rect" id="node6" href="a00101.html" title="The host_io_uart.h file contains the Host Protocol interface definitions and configuration. " alt="" coords="351,95,455,121"/>
71</map>
72</div>
73</div><div class="textblock"><div class="dynheader">
74This graph shows which files directly or indirectly include this file:</div>
75<div class="dyncontent">
76<div class="center"><img src="a00520.png" border="0" usemap="#drivers_2host_2data__format__json_8hdep" alt=""/></div>
77<map name="drivers_2host_2data__format__json_8hdep" id="drivers_2host_2data__format__json_8hdep">
78<area shape="rect" id="node2" href="a00098.html" title="The host_io_uart.c file contains definitions for UART based streaming interface for sending and resei..." alt="" coords="5,102,160,129"/>
79<area shape="rect" id="node3" href="a00515.html" title="The data_format_json.c file implements JSON data format interfaces and services. " alt="" coords="184,95,344,136"/>
80</map>
81</div>
82</div>
83<p><a href="a00518_source.html">Go to the source code of this file.</a></p>
84<table class="memberdecls">
85<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
86Macros</h2></td></tr>
87<tr class="memitem:afe179993f1441a41f3123a3be6fad79b"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00518.html#afe179993f1441a41f3123a3be6fad79b">HOST_INTERFACE</a>&#160;&#160;&#160;1</td></tr>
88<tr class="separator:afe179993f1441a41f3123a3be6fad79b"><td class="memSeparator" colspan="2">&#160;</td></tr>
89<tr class="memitem:aef13ac8d24ec9724b5495ca3271c0fc1"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00518.html#aef13ac8d24ec9724b5495ca3271c0fc1">DATA_FORMAT_JSON_OK</a>&#160;&#160;&#160;0</td></tr>
90<tr class="separator:aef13ac8d24ec9724b5495ca3271c0fc1"><td class="memSeparator" colspan="2">&#160;</td></tr>
91</table><table class="memberdecls">
92<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
93Typedefs</h2></td></tr>
94<tr class="memitem:ae0038000e88bf208b3967036ea637ac8"><td class="memItemLeft" align="right" valign="top">typedef enum <a class="el" href="a00518.html#ac7c4c4c9c4affd6956a0b4e8be396ae8">_json_format_</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00518.html#ae0038000e88bf208b3967036ea637ac8">json_format_t</a></td></tr>
95<tr class="separator:ae0038000e88bf208b3967036ea637ac8"><td class="memSeparator" colspan="2">&#160;</td></tr>
96</table><table class="memberdecls">
97<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a>
98Enumerations</h2></td></tr>
99<tr class="memitem:ac7c4c4c9c4affd6956a0b4e8be396ae8"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00518.html#ac7c4c4c9c4affd6956a0b4e8be396ae8">_json_format_</a> { <a class="el" href="a00518.html#ac7c4c4c9c4affd6956a0b4e8be396ae8a73030bbddd376c2f0419c46b4163e52f">JSON_TYPE_OBJECT</a>,
100<a class="el" href="a00518.html#ac7c4c4c9c4affd6956a0b4e8be396ae8ae2225dda6821202f523743113af2cae0">JSON_TYPE_ARRAY</a>
101 }</td></tr>
102<tr class="separator:ac7c4c4c9c4affd6956a0b4e8be396ae8"><td class="memSeparator" colspan="2">&#160;</td></tr>
103</table><table class="memberdecls">
104<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
105Functions</h2></td></tr>
106<tr class="memitem:a0e2d3b161cc458e4e69a2165518a9ac3"><td class="memItemLeft" align="right" valign="top"><a class="el" href="a00521.html#a5d7069350a7d7e65686c77a8038f462f">int32_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00518.html#a0e2d3b161cc458e4e69a2165518a9ac3">JSON_Serialize</a> (char *pStr, char *pDataTagStr, char *pDataValue, <a class="el" href="a00518.html#ae0038000e88bf208b3967036ea637ac8">json_format_t</a> type, bool end)</td></tr>
107<tr class="memdesc:a0e2d3b161cc458e4e69a2165518a9ac3"><td class="mdescLeft">&#160;</td><td class="mdescRight">The function to serialize the data,.  <a href="#a0e2d3b161cc458e4e69a2165518a9ac3">More...</a><br /></td></tr>
108<tr class="separator:a0e2d3b161cc458e4e69a2165518a9ac3"><td class="memSeparator" colspan="2">&#160;</td></tr>
109<tr class="memitem:a8e245cde75a5f95724bffe0ba96ce8ef"><td class="memItemLeft" align="right" valign="top"><a class="el" href="a00521.html#a5d7069350a7d7e65686c77a8038f462f">int32_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00518.html#a8e245cde75a5f95724bffe0ba96ce8ef">JSON_Deserialize</a> (void *pInData, void *pDataTag, char *pDataValue, <a class="el" href="a00518.html#ae0038000e88bf208b3967036ea637ac8">json_format_t</a> type)</td></tr>
110<tr class="memdesc:a8e245cde75a5f95724bffe0ba96ce8ef"><td class="mdescLeft">&#160;</td><td class="mdescRight">The function to deserialize the data,.  <a href="#a8e245cde75a5f95724bffe0ba96ce8ef">More...</a><br /></td></tr>
111<tr class="separator:a8e245cde75a5f95724bffe0ba96ce8ef"><td class="memSeparator" colspan="2">&#160;</td></tr>
112<tr class="memitem:a72cbdc06fad472bcc047c7e7761ec67c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00518.html#a72cbdc06fad472bcc047c7e7761ec67c">JSON_BlockDataRead_BlockingCall</a> (<a class="el" href="a00527.html#abaf1b61f9d5a80cabf1f3351bbd569e8">host_interface_handle_t</a> *pHandle, void *pRecvData)</td></tr>
113<tr class="memdesc:a72cbdc06fad472bcc047c7e7761ec67c"><td class="mdescLeft">&#160;</td><td class="mdescRight">The function provides block data read for the JSON stream, This is for Blocking receive call.  <a href="#a72cbdc06fad472bcc047c7e7761ec67c">More...</a><br /></td></tr>
114<tr class="separator:a72cbdc06fad472bcc047c7e7761ec67c"><td class="memSeparator" colspan="2">&#160;</td></tr>
115<tr class="memitem:ac17175f026a8004c8faa6e5217704797"><td class="memItemLeft" align="right" valign="top"><a class="el" href="a00521.html#a5d7069350a7d7e65686c77a8038f462f">int32_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00518.html#ac17175f026a8004c8faa6e5217704797">JSON_Get_Stream_NonBlockingCall</a> (void *pRecvData, uint8_t <a class="el" href="a00428.html#a0155cf01983779a6f386fb8eac40d37c">data</a>, uint8_t *state, uint8_t *buffIndex)</td></tr>
116<tr class="memdesc:ac17175f026a8004c8faa6e5217704797"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function is a helper function to get json stream where the data length is unknown.  <a href="#ac17175f026a8004c8faa6e5217704797">More...</a><br /></td></tr>
117<tr class="separator:ac17175f026a8004c8faa6e5217704797"><td class="memSeparator" colspan="2">&#160;</td></tr>
118<tr class="memitem:a82cfef5d07d5b3c2b1f8795309ab9e67"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00518.html#a82cfef5d07d5b3c2b1f8795309ab9e67">JSON_Process_Rx_Byte</a> (uint8_t c, <a class="el" href="a02927.html">host_rx_packet_t</a> *pHostRxPkt)</td></tr>
119<tr class="memdesc:a82cfef5d07d5b3c2b1f8795309ab9e67"><td class="mdescLeft">&#160;</td><td class="mdescRight">Function to handle incomming JSON encoded bytes form the Host over UART.  <a href="#a82cfef5d07d5b3c2b1f8795309ab9e67">More...</a><br /></td></tr>
120<tr class="separator:a82cfef5d07d5b3c2b1f8795309ab9e67"><td class="memSeparator" colspan="2">&#160;</td></tr>
121<tr class="memitem:abab3c54ca70a6f8384cd4aab3e475c19"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00518.html#abab3c54ca70a6f8384cd4aab3e475c19">JSON_Process_Tx_Msg</a> (const uint8_t *pBuffer, uint8_t *pMsg, size_t <a class="el" href="a00521.html#a18e09d6eabccd6dfc2d5066542020e59">size</a>)</td></tr>
122<tr class="separator:abab3c54ca70a6f8384cd4aab3e475c19"><td class="memSeparator" colspan="2">&#160;</td></tr>
123</table>
124<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
125<div class="textblock"><p>The format_json.h file describes the structures and definitions for the data-format standard JSON. </p>
126
127<p class="definition">Definition in file <a class="el" href="a00518_source.html">data_format_json.h</a>.</p>
128</div><h2 class="groupheader">Macro Definition Documentation</h2>
129<a id="aef13ac8d24ec9724b5495ca3271c0fc1"></a>
130<h2 class="memtitle"><span class="permalink"><a href="#aef13ac8d24ec9724b5495ca3271c0fc1">&#9670;&nbsp;</a></span>DATA_FORMAT_JSON_OK</h2>
131
132<div class="memitem">
133<div class="memproto">
134      <table class="memname">
135        <tr>
136          <td class="memname">#define DATA_FORMAT_JSON_OK&#160;&#160;&#160;0</td>
137        </tr>
138      </table>
139</div><div class="memdoc">
140
141<p class="definition">Definition at line <a class="el" href="a00518_source.html#l00023">23</a> of file <a class="el" href="a00518_source.html">data_format_json.h</a>.</p>
142
143<p class="reference">Referenced by <a class="el" href="a00515_source.html#l00069">JSON_Deserialize()</a>, <a class="el" href="a00515_source.html#l00117">JSON_Get_Stream_NonBlockingCall()</a>, and <a class="el" href="a00515_source.html#l00038">JSON_Serialize()</a>.</p>
144
145</div>
146</div>
147<a id="afe179993f1441a41f3123a3be6fad79b"></a>
148<h2 class="memtitle"><span class="permalink"><a href="#afe179993f1441a41f3123a3be6fad79b">&#9670;&nbsp;</a></span>HOST_INTERFACE</h2>
149
150<div class="memitem">
151<div class="memproto">
152      <table class="memname">
153        <tr>
154          <td class="memname">#define HOST_INTERFACE&#160;&#160;&#160;1</td>
155        </tr>
156      </table>
157</div><div class="memdoc">
158
159<p class="definition">Definition at line <a class="el" href="a00518_source.html#l00018">18</a> of file <a class="el" href="a00518_source.html">data_format_json.h</a>.</p>
160
161</div>
162</div>
163<h2 class="groupheader">Typedef Documentation</h2>
164<a id="ae0038000e88bf208b3967036ea637ac8"></a>
165<h2 class="memtitle"><span class="permalink"><a href="#ae0038000e88bf208b3967036ea637ac8">&#9670;&nbsp;</a></span>json_format_t</h2>
166
167<div class="memitem">
168<div class="memproto">
169      <table class="memname">
170        <tr>
171          <td class="memname">typedef enum <a class="el" href="a00518.html#ac7c4c4c9c4affd6956a0b4e8be396ae8">_json_format_</a>  <a class="el" href="a00518.html#ae0038000e88bf208b3967036ea637ac8">json_format_t</a></td>
172        </tr>
173      </table>
174</div><div class="memdoc">
175
176</div>
177</div>
178<h2 class="groupheader">Enumeration Type Documentation</h2>
179<a id="ac7c4c4c9c4affd6956a0b4e8be396ae8"></a>
180<h2 class="memtitle"><span class="permalink"><a href="#ac7c4c4c9c4affd6956a0b4e8be396ae8">&#9670;&nbsp;</a></span>_json_format_</h2>
181
182<div class="memitem">
183<div class="memproto">
184      <table class="memname">
185        <tr>
186          <td class="memname">enum <a class="el" href="a00518.html#ac7c4c4c9c4affd6956a0b4e8be396ae8">_json_format_</a></td>
187        </tr>
188      </table>
189</div><div class="memdoc">
190<table class="fieldtable">
191<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="ac7c4c4c9c4affd6956a0b4e8be396ae8a73030bbddd376c2f0419c46b4163e52f"></a>JSON_TYPE_OBJECT&#160;</td><td class="fielddoc"></td></tr>
192<tr><td class="fieldname"><a id="ac7c4c4c9c4affd6956a0b4e8be396ae8ae2225dda6821202f523743113af2cae0"></a>JSON_TYPE_ARRAY&#160;</td><td class="fielddoc"></td></tr>
193</table>
194
195<p class="definition">Definition at line <a class="el" href="a00518_source.html#l00028">28</a> of file <a class="el" href="a00518_source.html">data_format_json.h</a>.</p>
196
197</div>
198</div>
199<h2 class="groupheader">Function Documentation</h2>
200<a id="a72cbdc06fad472bcc047c7e7761ec67c"></a>
201<h2 class="memtitle"><span class="permalink"><a href="#a72cbdc06fad472bcc047c7e7761ec67c">&#9670;&nbsp;</a></span>JSON_BlockDataRead_BlockingCall()</h2>
202
203<div class="memitem">
204<div class="memproto">
205      <table class="memname">
206        <tr>
207          <td class="memname">void JSON_BlockDataRead_BlockingCall </td>
208          <td>(</td>
209          <td class="paramtype"><a class="el" href="a00527.html#abaf1b61f9d5a80cabf1f3351bbd569e8">host_interface_handle_t</a> *&#160;</td>
210          <td class="paramname"><em>pHandle</em>, </td>
211        </tr>
212        <tr>
213          <td class="paramkey"></td>
214          <td></td>
215          <td class="paramtype">void *&#160;</td>
216          <td class="paramname"><em>pRecvData</em>&#160;</td>
217        </tr>
218        <tr>
219          <td></td>
220          <td>)</td>
221          <td></td><td></td>
222        </tr>
223      </table>
224</div><div class="memdoc">
225
226<p>The function provides block data read for the JSON stream, This is for Blocking receive call. </p>
227<p>This can be the argument to host interface</p>
228<dl class="params"><dt>Parameters</dt><dd>
229  <table class="params">
230    <tr><td class="paramdir">[in]</td><td class="paramname">pHandle</td><td>- pointer to a formated data stream </td></tr>
231    <tr><td class="paramdir">[out]</td><td class="paramname">pRecvData</td><td>- Pointer to RecvBuffer; </td></tr>
232  </table>
233  </dd>
234</dl>
235<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
236<dl class="section user"><dt>Constraints:</dt><dd>None</dd></dl>
237<dl class="section user"><dt>Reentrant: Yes</dt><dd></dd></dl>
238
239<p class="definition">Definition at line <a class="el" href="a00515_source.html#l00075">75</a> of file <a class="el" href="a00515_source.html">data_format_json.c</a>.</p>
240
241<p class="reference">References <a class="el" href="a00527_source.html#l00036">_host_interface_handle_::commHandle</a>, <a class="el" href="a00428_source.html#l00174">data</a>, <a class="el" href="a00527_source.html#l00033">_host_interface_handle_::pCommInterface</a>, <a class="el" href="a00506_source.html#l00084">_comm_interface_::Receive</a>, <a class="el" href="a00515_source.html#l00030">STATE_NONE</a>, <a class="el" href="a00515_source.html#l00032">STATE_PAYLOAD</a>, and <a class="el" href="a00515_source.html#l00031">STATE_START_PACKET</a>.</p>
242
243</div>
244</div>
245<a id="a8e245cde75a5f95724bffe0ba96ce8ef"></a>
246<h2 class="memtitle"><span class="permalink"><a href="#a8e245cde75a5f95724bffe0ba96ce8ef">&#9670;&nbsp;</a></span>JSON_Deserialize()</h2>
247
248<div class="memitem">
249<div class="memproto">
250      <table class="memname">
251        <tr>
252          <td class="memname"><a class="el" href="a00521.html#a5d7069350a7d7e65686c77a8038f462f">int32_t</a> JSON_Deserialize </td>
253          <td>(</td>
254          <td class="paramtype">void *&#160;</td>
255          <td class="paramname"><em>pInData</em>, </td>
256        </tr>
257        <tr>
258          <td class="paramkey"></td>
259          <td></td>
260          <td class="paramtype">void *&#160;</td>
261          <td class="paramname"><em>pDataTag</em>, </td>
262        </tr>
263        <tr>
264          <td class="paramkey"></td>
265          <td></td>
266          <td class="paramtype">char *&#160;</td>
267          <td class="paramname"><em>pDataValue</em>, </td>
268        </tr>
269        <tr>
270          <td class="paramkey"></td>
271          <td></td>
272          <td class="paramtype"><a class="el" href="a00518.html#ae0038000e88bf208b3967036ea637ac8">json_format_t</a>&#160;</td>
273          <td class="paramname"><em>type</em>&#160;</td>
274        </tr>
275        <tr>
276          <td></td>
277          <td>)</td>
278          <td></td><td></td>
279        </tr>
280      </table>
281</div><div class="memdoc">
282
283<p>The function to deserialize the data,. </p>
284<p>it applys the deserialization in a single data element,</p>
285<dl class="params"><dt>Parameters</dt><dd>
286  <table class="params">
287    <tr><td class="paramdir">[in]</td><td class="paramname">pStr</td><td>- pointer to a formated data stream </td></tr>
288    <tr><td class="paramdir">[out]</td><td class="paramname">pDataTagStr</td><td>- Data tag name for a data </td></tr>
289    <tr><td class="paramdir">[out]</td><td class="paramname">pDataValue</td><td>- Data value </td></tr>
290    <tr><td class="paramdir">[in]</td><td class="paramname">type</td><td>- Json data type </td></tr>
291  </table>
292  </dd>
293</dl>
294<dl class="section return"><dt>Returns</dt><dd><a class="el" href="a00518.html#a8e245cde75a5f95724bffe0ba96ce8ef" title="The function to deserialize the data,. ">JSON_Deserialize()</a> returns the status .</dd></dl>
295<dl class="section user"><dt>Constraints:</dt><dd>None</dd></dl>
296<dl class="section user"><dt>Reentrant: Yes</dt><dd></dd></dl>
297
298<p class="definition">Definition at line <a class="el" href="a00515_source.html#l00069">69</a> of file <a class="el" href="a00515_source.html">data_format_json.c</a>.</p>
299
300<p class="reference">References <a class="el" href="a00518_source.html#l00023">DATA_FORMAT_JSON_OK</a>.</p>
301
302</div>
303</div>
304<a id="ac17175f026a8004c8faa6e5217704797"></a>
305<h2 class="memtitle"><span class="permalink"><a href="#ac17175f026a8004c8faa6e5217704797">&#9670;&nbsp;</a></span>JSON_Get_Stream_NonBlockingCall()</h2>
306
307<div class="memitem">
308<div class="memproto">
309      <table class="memname">
310        <tr>
311          <td class="memname"><a class="el" href="a00521.html#a5d7069350a7d7e65686c77a8038f462f">int32_t</a> JSON_Get_Stream_NonBlockingCall </td>
312          <td>(</td>
313          <td class="paramtype">void *&#160;</td>
314          <td class="paramname"><em>pRecvData</em>, </td>
315        </tr>
316        <tr>
317          <td class="paramkey"></td>
318          <td></td>
319          <td class="paramtype">uint8_t&#160;</td>
320          <td class="paramname"><em>data</em>, </td>
321        </tr>
322        <tr>
323          <td class="paramkey"></td>
324          <td></td>
325          <td class="paramtype">uint8_t *&#160;</td>
326          <td class="paramname"><em>state</em>, </td>
327        </tr>
328        <tr>
329          <td class="paramkey"></td>
330          <td></td>
331          <td class="paramtype">uint8_t *&#160;</td>
332          <td class="paramname"><em>buffIndex</em>&#160;</td>
333        </tr>
334        <tr>
335          <td></td>
336          <td>)</td>
337          <td></td><td></td>
338        </tr>
339      </table>
340</div><div class="memdoc">
341
342<p>This function is a helper function to get json stream where the data length is unknown. </p>
343<p>Basically look for start and end packets and form a packet</p>
344<dl class="params"><dt>Parameters</dt><dd>
345  <table class="params">
346    <tr><td class="paramdir">[out]</td><td class="paramname">pRecvData</td><td>- Pointer to RecvBuffer; </td></tr>
347    <tr><td class="paramdir">[out]</td><td class="paramname">data</td><td>- one byte of data received. [in] event - status event for send complete and receive complete </td></tr>
348  </table>
349  </dd>
350</dl>
351<dl class="section return"><dt>Returns</dt><dd>DATA_FORMAT_JSON_OK, if data read is completed. else still get more data.</dd></dl>
352<dl class="section user"><dt>Constraints:</dt><dd>None</dd></dl>
353<dl class="section user"><dt>Reentrant: Yes</dt><dd></dd></dl>
354
355<p class="definition">Definition at line <a class="el" href="a00515_source.html#l00117">117</a> of file <a class="el" href="a00515_source.html">data_format_json.c</a>.</p>
356
357<p class="reference">References <a class="el" href="a00518_source.html#l00023">DATA_FORMAT_JSON_OK</a>, <a class="el" href="a00515_source.html#l00030">STATE_NONE</a>, <a class="el" href="a00515_source.html#l00032">STATE_PAYLOAD</a>, and <a class="el" href="a00515_source.html#l00031">STATE_START_PACKET</a>.</p>
358
359</div>
360</div>
361<a id="a82cfef5d07d5b3c2b1f8795309ab9e67"></a>
362<h2 class="memtitle"><span class="permalink"><a href="#a82cfef5d07d5b3c2b1f8795309ab9e67">&#9670;&nbsp;</a></span>JSON_Process_Rx_Byte()</h2>
363
364<div class="memitem">
365<div class="memproto">
366      <table class="memname">
367        <tr>
368          <td class="memname">bool JSON_Process_Rx_Byte </td>
369          <td>(</td>
370          <td class="paramtype">uint8_t&#160;</td>
371          <td class="paramname"><em>c</em>, </td>
372        </tr>
373        <tr>
374          <td class="paramkey"></td>
375          <td></td>
376          <td class="paramtype"><a class="el" href="a02927.html">host_rx_packet_t</a> *&#160;</td>
377          <td class="paramname"><em>pHostRxPkt</em>&#160;</td>
378        </tr>
379        <tr>
380          <td></td>
381          <td>)</td>
382          <td></td><td></td>
383        </tr>
384      </table>
385</div><div class="memdoc">
386
387<p>Function to handle incomming JSON encoded bytes form the Host over UART. </p>
388<p>This function will be called on receipt of every UART Byte and will do the JSON combination to create a Host Message. </p><dl class="params"><dt>Parameters</dt><dd>
389  <table class="params">
390    <tr><td class="paramdir">[in]</td><td class="paramname">uint8_t</td><td>c The character in the UART payload. </td></tr>
391    <tr><td class="paramdir">[in]</td><td class="paramname"><a class="el" href="a02927.html" title="This structure holds information to receive a packet of data to the host. ">host_rx_packet_t</a></td><td>*pHostRxPkt The Host Packet context structure. </td></tr>
392  </table>
393  </dd>
394</dl>
395<dl class="section return"><dt>Returns</dt><dd>bool Success/Failure. </dd></dl>
396<dl class="section user"><dt>Constraints:</dt><dd>This should be the called only after DEBUG/UART has been initialized.  No </dd></dl>
397
398<p class="definition">Definition at line <a class="el" href="a00515_source.html#l00158">158</a> of file <a class="el" href="a00515_source.html">data_format_json.c</a>.</p>
399
400<p class="reference">Referenced by <a class="el" href="a00098_source.html#l00207">Host_IO_Receive()</a>.</p>
401<div class="dynheader">
402Here is the caller graph for this function:</div>
403<div class="dyncontent">
404<div class="center"><img src="a00518_a82cfef5d07d5b3c2b1f8795309ab9e67_icgraph.png" border="0" usemap="#a00518_a82cfef5d07d5b3c2b1f8795309ab9e67_icgraph" alt=""/></div>
405<map name="a00518_a82cfef5d07d5b3c2b1f8795309ab9e67_icgraph" id="a00518_a82cfef5d07d5b3c2b1f8795309ab9e67_icgraph">
406<area shape="rect" id="node2" href="a00101.html#a3924d21a0703878695ebdb68f720fff9" title="Host_IO_Receive" alt="" coords="221,5,343,32"/>
407</map>
408</div>
409
410</div>
411</div>
412<a id="abab3c54ca70a6f8384cd4aab3e475c19"></a>
413<h2 class="memtitle"><span class="permalink"><a href="#abab3c54ca70a6f8384cd4aab3e475c19">&#9670;&nbsp;</a></span>JSON_Process_Tx_Msg()</h2>
414
415<div class="memitem">
416<div class="memproto">
417      <table class="memname">
418        <tr>
419          <td class="memname">size_t JSON_Process_Tx_Msg </td>
420          <td>(</td>
421          <td class="paramtype">const uint8_t *&#160;</td>
422          <td class="paramname"><em>pBuffer</em>, </td>
423        </tr>
424        <tr>
425          <td class="paramkey"></td>
426          <td></td>
427          <td class="paramtype">uint8_t *&#160;</td>
428          <td class="paramname"><em>pMsg</em>, </td>
429        </tr>
430        <tr>
431          <td class="paramkey"></td>
432          <td></td>
433          <td class="paramtype">size_t&#160;</td>
434          <td class="paramname"><em>size</em>&#160;</td>
435        </tr>
436        <tr>
437          <td></td>
438          <td>)</td>
439          <td></td><td></td>
440        </tr>
441      </table>
442</div><div class="memdoc">
443
444<p class="definition">Definition at line <a class="el" href="a00515_source.html#l00164">164</a> of file <a class="el" href="a00515_source.html">data_format_json.c</a>.</p>
445
446<p class="reference">Referenced by <a class="el" href="a00098_source.html#l00136">Host_IO_Send()</a>.</p>
447<div class="dynheader">
448Here is the caller graph for this function:</div>
449<div class="dyncontent">
450<div class="center"><img src="a00518_abab3c54ca70a6f8384cd4aab3e475c19_icgraph.png" border="0" usemap="#a00518_abab3c54ca70a6f8384cd4aab3e475c19_icgraph" alt=""/></div>
451<map name="a00518_abab3c54ca70a6f8384cd4aab3e475c19_icgraph" id="a00518_abab3c54ca70a6f8384cd4aab3e475c19_icgraph">
452<area shape="rect" id="node2" href="a00101.html#a719ad6da4502e713f1573b5353af9617" title="Host_IO_Send" alt="" coords="217,5,324,32"/>
453</map>
454</div>
455
456</div>
457</div>
458<a id="a0e2d3b161cc458e4e69a2165518a9ac3"></a>
459<h2 class="memtitle"><span class="permalink"><a href="#a0e2d3b161cc458e4e69a2165518a9ac3">&#9670;&nbsp;</a></span>JSON_Serialize()</h2>
460
461<div class="memitem">
462<div class="memproto">
463      <table class="memname">
464        <tr>
465          <td class="memname"><a class="el" href="a00521.html#a5d7069350a7d7e65686c77a8038f462f">int32_t</a> JSON_Serialize </td>
466          <td>(</td>
467          <td class="paramtype">char *&#160;</td>
468          <td class="paramname"><em>pStr</em>, </td>
469        </tr>
470        <tr>
471          <td class="paramkey"></td>
472          <td></td>
473          <td class="paramtype">char *&#160;</td>
474          <td class="paramname"><em>pDataTagStr</em>, </td>
475        </tr>
476        <tr>
477          <td class="paramkey"></td>
478          <td></td>
479          <td class="paramtype">char *&#160;</td>
480          <td class="paramname"><em>pDataValue</em>, </td>
481        </tr>
482        <tr>
483          <td class="paramkey"></td>
484          <td></td>
485          <td class="paramtype"><a class="el" href="a00518.html#ae0038000e88bf208b3967036ea637ac8">json_format_t</a>&#160;</td>
486          <td class="paramname"><em>type</em>, </td>
487        </tr>
488        <tr>
489          <td class="paramkey"></td>
490          <td></td>
491          <td class="paramtype">bool&#160;</td>
492          <td class="paramname"><em>end</em>&#160;</td>
493        </tr>
494        <tr>
495          <td></td>
496          <td>)</td>
497          <td></td><td></td>
498        </tr>
499      </table>
500</div><div class="memdoc">
501
502<p>The function to serialize the data,. </p>
503<p>it applys the serialization in single data element, Once user finishes the data stream with different data tag, set end flag to TRUE.</p>
504<dl class="params"><dt>Parameters</dt><dd>
505  <table class="params">
506    <tr><td class="paramdir">[in]</td><td class="paramname">pStr</td><td>- pointer to the data stream - formated data put into this buffer </td></tr>
507    <tr><td class="paramdir">[in]</td><td class="paramname">pDataTagStr</td><td>- Data tag name for a data </td></tr>
508    <tr><td class="paramdir">[in]</td><td class="paramname">pDataValue</td><td>- Data value </td></tr>
509    <tr><td class="paramdir">[in]</td><td class="paramname">type</td><td>- Json data type </td></tr>
510    <tr><td class="paramdir">[in]</td><td class="paramname">end</td><td>- flag determine the end of data stream serialization. </td></tr>
511  </table>
512  </dd>
513</dl>
514<dl class="section return"><dt>Returns</dt><dd><a class="el" href="a00518.html#a0e2d3b161cc458e4e69a2165518a9ac3" title="The function to serialize the data,. ">JSON_Serialize()</a> returns the status .</dd></dl>
515<dl class="section user"><dt>Constraints:</dt><dd>None</dd></dl>
516<dl class="section user"><dt>Reentrant: Yes</dt><dd></dd></dl>
517
518<p class="definition">Definition at line <a class="el" href="a00515_source.html#l00038">38</a> of file <a class="el" href="a00515_source.html">data_format_json.c</a>.</p>
519
520<p class="reference">References <a class="el" href="a00518_source.html#l00023">DATA_FORMAT_JSON_OK</a>, <a class="el" href="a00515_source.html#l00021">gpJsonFooter</a>, <a class="el" href="a00515_source.html#l00020">gpJsonHeader</a>, and <a class="el" href="a00518_source.html#l00030">JSON_TYPE_OBJECT</a>.</p>
521
522</div>
523</div>
524</div><!-- contents -->
525
526<hr class="footer"/><address class="footer"><small>
527&copy; Copyright 2016-2022 NXP. All Rights Reserved. SPDX-License-Identifier: BSD-3-Clause
528</small></address>
529</body>
530</html>
531