WE310F5  39.00.000
m2mb_json.h
Go to the documentation of this file.
1 /*===============================================================================================*/
2 /* >>> Copyright (C) Telit Communications S.p.A. Italy All Rights Reserved. <<< */
28 #ifndef _M2MB_JSON_H_
29 #define _M2MB_JSON_H_
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
51 /*-----------------------------------------------------------------------------------------------*/
52 
57 /*-----------------------------------------------------------------------------------------------*/
58 
59 /*===============================================================================================*/
60 /* Global typedefs ==============================================================================*/
61 
69 typedef enum M2MB_JSON_OBJ_TYPE
70 {
74 
80 typedef enum M2MB_JSON_DATA_TYPE
81 {
108 
109 
115 typedef struct M2MB_JSON_NODE
116 {
121 
127 typedef struct M2MB_JSON_DATE
128 {
135 
143 typedef struct M2MB_JSON_TIME
144 {
151 
159 typedef struct M2MB_JSON_DATE_TIME
160 {
170 
178 typedef struct M2MB_JSON_DURATION
179 {
187 
195 typedef struct M2MB_JSON_HEX
196 {
200 
201 
209 typedef struct M2MB_JSON_OBJ
210 {
223 
232 {
234  const M2MB_JSON_OBJ_T **pObj ; //[20];
236 
244 typedef struct M2MB_JSON_COMPLEX_OBJ
245 {
249 
250 /*---------------------------------------------------------------------------*/
344 /*---------------------------------------------------------------------------*/
346  UINT8 *usrStruct, UINT8 *jsonFileBuffer, UINT32 jsonFileBufferSize,
347  UINT32 *lenOfJsonWritten);
348 
349 /*---------------------------------------------------------------------------*/
439 /*---------------------------------------------------------------------------*/
440 M2MB_STATUS_T m2mb_json_decode( UINT8 *parent_start, UINT8* parent_end,
441  M2MB_JSON_COMPLEX_OBJ_T *jsonSchema, UINT8 *returnStruct);
442 
443 /*---------------------------------------------------------------------------*/
478 /*---------------------------------------------------------------------------*/
479 UINT16 m2mb_json_node_get( M2MB_JSON_NODE_T *pCNode, UINT8 *pPNStart,
480  UINT8 *pPNEnd);
481 
482 /*---------------------------------------------------------------------------*/
517 /*---------------------------------------------------------------------------*/
518 UINT16 m2mb_json_node_occ_get( UINT8 *pTName, UINT8 *pPNStart,
519  UINT8 *pPNEnd );
520 
521 /*---------------------------------------------------------------------------*/
522 
526 /*-----------------------------------------------------------------------------------------------*/
527 
528 #ifdef __cplusplus
529 }
530 #endif
531 #endif /* _M2MB_JSON_H_ */
struct M2MB_JSON_COMPLEX_INFO M2MB_JSON_COMPLEX_INFO_T
Json complex information structure.
M2MB_JSON_OBJ_TYPE_T objType
Definition: m2mb_json.h:214
struct M2MB_JSON_HEX M2MB_JSON_HEX_T
HEX stream structure json.
UINT8 * pStart
Definition: m2mb_json.h:118
unsigned char UINT8
Definition: m2mb_types.h:86
struct M2MB_JSON_OBJ M2MB_JSON_OBJ_T
Json object structure.
const M2MB_JSON_OBJ_T ** pObj
Definition: m2mb_json.h:234
UINT8 minOffset
Definition: m2mb_json.h:149
UINT16 size
Definition: m2mb_json.h:221
enum M2MB_JSON_OBJ_TYPE M2MB_JSON_OBJ_TYPE_T
Object type supported by the json.
struct M2MB_JSON_DATE M2MB_JSON_DATE_T
Json date structure json.
M2MB_JSON_COMPLEX_INFO_T complex_obj
Definition: m2mb_json.h:247
M2MB_STATUS_T m2mb_json_encode(M2MB_JSON_COMPLEX_OBJ_T *jsonSchema, UINT8 *usrStruct, UINT8 *jsonFileBuffer, UINT32 jsonFileBufferSize, UINT32 *lenOfJsonWritten)
Encode API for JSON module.
Json time structure json.
Definition: m2mb_json.h:143
INT32 M2MB_STATUS_T
Definition: m2mb_status.h:97
UINT8 * pEnd
Definition: m2mb_json.h:119
enum M2MB_JSON_DATA_TYPE M2MB_JSON_DATA_TYPE_T
Data type supported by the json.
struct M2MB_JSON_DURATION M2MB_JSON_DURATION_T
Json duration structure.
UINT16 m2mb_json_node_get(M2MB_JSON_NODE_T *pCNode, UINT8 *pPNStart, UINT8 *pPNEnd)
Get node API for JSON module.
M2MB_JSON_OBJ_T obj
Definition: m2mb_json.h:246
unsigned short UINT16
Definition: m2mb_types.h:87
Json complex information structure.
Definition: m2mb_json.h:231
UINT16 m2mb_json_node_occ_get(UINT8 *pTName, UINT8 *pPNStart, UINT8 *pPNEnd)
Occurrence of node present API for JSON module.
struct M2MB_JSON_NODE M2MB_JSON_NODE_T
Json node structure.
struct M2MB_JSON_TIME M2MB_JSON_TIME_T
Json time structure json.
M2MB_JSON_DATA_TYPE
Data type supported by the json.
Definition: m2mb_json.h:80
UINT16 len
Definition: m2mb_json.h:197
UINT8 hrOffset
Definition: m2mb_json.h:148
UINT8 hrOffset
Definition: m2mb_json.h:132
Json duration structure.
Definition: m2mb_json.h:178
Json date structure json.
Definition: m2mb_json.h:127
struct M2MB_JSON_COMPLEX_OBJ M2MB_JSON_COMPLEX_OBJ_T
Json complex object structure.
UINT8 * pName
Definition: m2mb_json.h:212
M2MB_JSON_DATA_TYPE_T dataType
Definition: m2mb_json.h:216
Json object structure.
Definition: m2mb_json.h:209
Json date & time structure json.
Definition: m2mb_json.h:159
Json node structure.
Definition: m2mb_json.h:115
UINT8 * pName
Definition: m2mb_json.h:117
unsigned long int UINT32
Definition: m2mb_types.h:88
UINT8 * ptr
Definition: m2mb_json.h:198
Json complex object structure.
Definition: m2mb_json.h:244
HEX stream structure json.
Definition: m2mb_json.h:195
M2MB_STATUS_T m2mb_json_decode(UINT8 *parent_start, UINT8 *parent_end, M2MB_JSON_COMPLEX_OBJ_T *jsonSchema, UINT8 *returnStruct)
Decode API for JSON module.
struct M2MB_JSON_DATE_TIME M2MB_JSON_DATE_TIME_T
Json date & time structure json.
UINT8 minOffset
Definition: m2mb_json.h:133
UINT8 maxObjOcc
Definition: m2mb_json.h:218
UINT16 offset
Definition: m2mb_json.h:220
M2MB_JSON_OBJ_TYPE
Object type supported by the json.
Definition: m2mb_json.h:69