![]() |
WE310F5
39.00.000
|
This section describes the M2MB APIs for XML module. More...
This section describes the M2MB APIs for XML module.
XML modules provides APIs to decodes a XML string and fills the parameters in the provided structure. Similarly, it also provides APIs to encode XMLstring from the provided structure. The structure information and the XML tag information are given to the XML module in a proprietary embedded schema format. Each TAG in XML string is defined in a structured format that gives the detail information about it, like the tag name, tag type, info on where to decode and fill the data of the tag, tag data type.
typedef struct M2MB_XML_COMPLEX_INFO M2MB_XML_COMPLEX_INFO_T |
XML complex information structure.
XML complex information structure.
typedef struct M2MB_XML_COMPLEX_OBJ M2MB_XML_COMPLEX_OBJ_T |
Xml complex object structure.
Xml complex object structure.
typedef enum M2MB_XML_DATA_TYPE M2MB_XML_DATA_TYPE_T |
Data type supported by the XML.
List of data types supported by XML module.
typedef struct M2MB_XML_DATE M2MB_XML_DATE_T |
XML date structure xml.
Date structure XML module.
typedef struct M2MB_XML_DATE_TIME M2MB_XML_DATE_TIME_T |
Xml date & time structure xml.
Date & Time structure xml module.
typedef struct M2MB_XML_DURATION M2MB_XML_DURATION_T |
Xml duration structure.
Duration structure xml module.
typedef struct M2MB_XML_NODE M2MB_XML_NODE_T |
Xml node structure.
Xml node structure.
typedef struct M2MB_XML_OBJ M2MB_XML_OBJ_T |
Xml object structure.
Xml object structure.
typedef enum M2MB_XML_OBJ_TYPE M2MB_XML_OBJ_TYPE_T |
Object type supported by the xml.
List of object types supported by xml module.
typedef struct M2MB_XML_STRING M2MB_XML_STRING_T |
Duration structure XML.
Duration structure XML module.
typedef struct M2MB_XML_TIME M2MB_XML_TIME_T |
Xml time structure xml.
Time structure xml module.
enum M2MB_XML_DATA_TYPE |
Data type supported by the XML.
List of data types supported by XML module.
Definition at line 87 of file m2mb_xml.h.
enum M2MB_XML_OBJ_TYPE |
Object type supported by the xml.
List of object types supported by xml module.
Enumerator | |
---|---|
M2MB_XML_COMPLEX_ELEMENT | Complex element |
M2MB_XML_SIMPLE_ELEMENT | Simple element |
M2MB_XML_ATTRIBUTE | Attribute |
M2MB_XML_NONE | Not in use |
Definition at line 72 of file m2mb_xml.h.
M2MB_STATUS_T m2mb_xml_decode | ( | UINT8 * | parent_start, |
UINT8 * | parent_end, | ||
M2MB_XML_COMPLEX_OBJ_T * | xml_schema, | ||
UINT8 * | return_struct | ||
) |
Decode API for XML module.
This function decode the XML file, extract the data and fill that on user structure.
[in] | parent_start | The starting address of the XML file |
[in] | parent_end | The Ending address of the XML file. |
[in] | xml_schema | |
[in] | return_struct | The user structure buffer to be filled with the data. |
M2MB_STATUS_T m2mb_xml_encode | ( | M2MB_XML_COMPLEX_OBJ_T * | xml_schema, |
UINT8 * | user_struct, | ||
UINT8 * | xml_file_buffer, | ||
UINT32 | xml_file_buffer_Size, | ||
UINT32 * | len_of_xml_written | ||
) |
Encode API for XML module.
This function create the XML file from the data structure and the XML schema.
[in] | xml_schema | The xml schema for XML file. |
[in] | user_struct | The user structure which holds all data to be encoded. |
[in] | xml_file_buffer | The user buffer which will be filled with the XML file. |
[in] | xml_file_buffer_Size | Total Size of the user buffer. |
[in] | len_of_xml_written | Size of the user buffer filled with XML file. |
M2MB_STATUS_T m2mb_xml_node_get | ( | M2MB_XML_NODE_T * | child_node, |
UINT8 * | parent_node_start, | ||
UINT8 * | parent_node_end, | ||
UINT8 * | tag_end | ||
) |
Get node API for XML module.
This function gets the node information from the XML file. It fills the child_node(child node structure) if it finds the tag. The tag name is taken from the parent name element in the child_node
[in] | child_node | XML child node details. User has to fill the name of the tag and the API would fill the start and end pointer with in the pPNStart and pPNEnd pointer. |
[in] | parent_node_start | The starting address of the XML file. |
[in] | parent_node_end | The Ending address of the XML file. |
[in] | tag_end | The Ending tag of the XML file. |
Occurrence of node present API for XML module.
This function finds the occurrence of a tag within the start and end pointer given.
[in] | pTName | Name of the tag. |
[in] | pPNStart | The starting address of the XML file. |
[in] | pPNEnd | The Ending address of the XML file. |