appHand_service.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /*
  2. * Copyright (C) 2007-2010 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. *
  14. * You should have received a copy of the GNU Lesser General Public License
  15. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. */
  17. /*******************************************************************
  18. *
  19. * @author Sebastian.Kaebisch.EXT@siemens.com
  20. * @version 0.6
  21. * @contact Joerg.Heuer@siemens.com
  22. *
  23. ********************************************************************/
  24. #ifdef __cplusplus
  25. extern "C" {
  26. #endif
  27. #ifndef EXI_DATABINDER_H_
  28. #define EXI_DATABINDER_H_
  29. #include "appHand_dataTypes.h"
  30. struct uniqueIDPath2
  31. {
  32. int id[10];
  33. size_t pos;
  34. };
  35. struct EXIDatabinder
  36. {
  37. /* in-/ out-stream */
  38. bitstream_t inStream;
  39. bitstream_t outStream;
  40. /* EXI */
  41. exi_state_t stateDecode;
  42. exi_state_t stateEncode;
  43. exi_event_t event;
  44. eqname_t eqn;
  45. exi_value_t val;
  46. /* main message data structure */
  47. struct EXIDocumentType_appHand exiMsg;
  48. /* unique id for ambiguous elements */
  49. struct uniqueIDPath2 idPath;
  50. uint16_t transportHeaderOffset;
  51. /* error code */
  52. uint8_t errorCode;
  53. };
  54. int serialize_appHand(struct EXIDatabinder* service, uint8_t* outStream, uint16_t* outPos, struct EXIDocumentType_appHand* exiDoc);
  55. int deserialize_appHand(struct EXIDatabinder* service, uint8_t* inStream, uint16_t sizeInStream, struct EXIDocumentType_appHand* exiDoc);
  56. int init_appHandSerializer(struct EXIDatabinder* service, bytes_t bytes, string_ucs_t string, size_t max_outStream_size, uint16_t transportHeaderOffset);
  57. int init_appHandDeserializer(struct EXIDatabinder* service, bytes_t bytes, string_ucs_t string, uint16_t transportHeaderOffset);
  58. /* define error codes (TODO: define precise error codes) */
  59. #define EXI_NON_VALID_MESSAGE 0x01
  60. #define EXI_SERIALIZATION_FAILED 0x02
  61. #define EXI_UNKNOWN_ERROR 0xFF
  62. #endif /* EXI_DATABINDER_H_ */
  63. #ifdef __cplusplus
  64. }
  65. #endif