appHandEXIDecoder.h 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. /*
  2. * Copyright (C) 2007-2013 Siemens AG
  3. *
  4. * This program is free software: you can redistribute it and/or modify
  5. * it under the terms of the GNU Lesser General Public License as published
  6. * by the Free Software Foundation, either version 3 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU Lesser General Public License for more details.
  13. * GNU Lesser General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU Lesser General Public License
  16. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. /*******************************************************************
  19. *
  20. * @author Daniel.Peintner.EXT@siemens.com
  21. * @version 0.8
  22. * @contact Joerg.Heuer@siemens.com
  23. *
  24. * <p>Code generated by EXIdizer.com</p>
  25. * <p>Schema: input/appHandshake/V2G_CI_AppProtocol.xsd</p>
  26. *
  27. *
  28. ********************************************************************/
  29. #ifdef __cplusplus
  30. extern "C" {
  31. #endif
  32. #ifndef EXI_appHand_DECODER_H
  33. #define EXI_appHand_DECODER_H
  34. /**
  35. * \file EXIDecoder.h
  36. * \brief EXI Decoder
  37. *
  38. */
  39. #include "EXITypes.h"
  40. /**
  41. * \brief Initialize EXI decoder
  42. *
  43. * Resets & initializes the EXI decoder.
  44. *
  45. * \param stream Input Stream
  46. * \param state Codec state
  47. * \param runtimeTable Runtime name-tables
  48. * \param stringTable String table
  49. * \return Error-Code <> 0
  50. *
  51. */
  52. int exiappHandInitDecoder(bitstream_t* stream, exi_state_t* state,
  53. exi_name_table_runtime_t runtimeTable, exi_value_table_t stringTable);
  54. /**
  55. * \brief Reports last decoded qualified name
  56. *
  57. * Note: Qualified name only available for previously unknown qname. Otherwise make use of name table entries.
  58. *
  59. * \param qname Qualified name
  60. * \return Error-Code <> 0
  61. *
  62. */
  63. int exiappHandGetLastQName(exi_qname_t** qname);
  64. /**
  65. * \brief Decodes next event
  66. *
  67. * Inspects EXI stream and decodes next EXI event.
  68. *
  69. * \param stream Input Stream
  70. * \param state Codec state
  71. * \param nextEvent Next event
  72. * \return Error-Code <> 0
  73. *
  74. */
  75. int exiappHandDecodeNextEvent(bitstream_t* stream,
  76. exi_state_t* state, exi_event_t* nextEvent);
  77. /**
  78. * \brief Decodes StartDocument (SD) event
  79. *
  80. * \param stream Input Stream
  81. * \param state Codec state
  82. * \return Error-Code <> 0
  83. *
  84. */
  85. int exiappHandDecodeStartDocument(bitstream_t* stream,
  86. exi_state_t* state);
  87. /**
  88. * \brief Decodes EndDocument (ED) event
  89. *
  90. * \param stream Input Stream
  91. * \param state Codec state
  92. * \return Error-Code <> 0
  93. *
  94. */
  95. int exiappHandDecodeEndDocument(bitstream_t* stream,
  96. exi_state_t* state);
  97. /**
  98. * \brief Decodes StartElement (SE) event
  99. *
  100. * Note: The first time a qnameID is larger than schema-informed NUMBER_OF_QNAMES it is possible to retrieve the qname by calling GetLastQName(...).
  101. * It is up to the caller to track qnames.
  102. *
  103. * \param stream Input Stream
  104. * \param state Codec state
  105. * \param qnameID Qualified Name ID
  106. * \return Error-Code <> 0
  107. *
  108. */
  109. int
  110. exiappHandDecodeStartElement(bitstream_t* stream,
  111. exi_state_t* state, uint16_t* qnameID);
  112. /**
  113. * \brief Decodes EndElement (EE) event
  114. *
  115. * \param stream Input Stream
  116. * \param state Codec state
  117. * \param qnameID Qualified Name ID
  118. * \return Error-Code <> 0
  119. *
  120. */
  121. int exiappHandDecodeEndElement(bitstream_t* stream,
  122. exi_state_t* state, uint16_t* qnameID);
  123. /**
  124. * \brief Decodes Characters (CH) event.
  125. *
  126. * Reports characters value.
  127. *
  128. * \param stream Input Stream
  129. * \param state Codec state
  130. * \param val Characters value
  131. * \return Error-Code <> 0
  132. *
  133. */
  134. int exiappHandDecodeCharacters(bitstream_t* stream,
  135. exi_state_t* state, exi_value_t* val);
  136. /**
  137. * \brief Decodes Attribute (AT) event.
  138. *
  139. * Reports attribute qname and value.
  140. *
  141. * \param stream Input Stream
  142. * \param state Codec state
  143. * \param qnameID Qualified Name ID
  144. * \param val Characters value
  145. * \return Error-Code <> 0
  146. *
  147. */
  148. int exiappHandDecodeAttribute(bitstream_t* stream,
  149. exi_state_t* state, uint16_t* qnameID, exi_value_t* val);
  150. /**
  151. * \brief Decodes attribute xsi:nil
  152. *
  153. * Reports value.
  154. *
  155. * \param stream Input Stream
  156. * \param state Codec state
  157. * \param val Characters value
  158. * \return Error-Code <> 0
  159. *
  160. */
  161. int exiappHandDecodeAttributeXsiNil(bitstream_t* stream,
  162. exi_state_t* state, exi_value_t* val);
  163. /**
  164. * \brief Decodes attribute xsi:type
  165. *
  166. * Reports value.
  167. *
  168. * \param stream Input Stream
  169. * \param state Codec state
  170. * \param val Characters value
  171. * \return Error-Code <> 0
  172. *
  173. */
  174. int exiappHandDecodeAttributeXsiType(bitstream_t* stream,
  175. exi_state_t* state, exi_value_t* val);
  176. /**
  177. * \brief Decodes attribute/characters list value
  178. *
  179. * List values are special and are processed one by one.
  180. *
  181. * \param stream Input Stream
  182. * \param state Codec state
  183. * \param qnameID Qualified Name ID
  184. * \param val List value
  185. * \param lt List type
  186. * \return Error-Code <> 0
  187. *
  188. */
  189. int exiappHandDecodeListValue(bitstream_t* stream, exi_state_t* state, uint16_t qnameID,
  190. exi_value_t* val, exi_list_t lt);
  191. #endif
  192. #ifdef __cplusplus
  193. }
  194. #endif