v2g_service.h 1.8 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.5
  21. * @contact Joerg.Heuer@siemens.com
  22. *
  23. ********************************************************************/
  24. #ifdef __cplusplus
  25. extern "C" {
  26. #endif
  27. #ifndef EXI_SERVICE_H_
  28. #define EXI_SERVICE_H_
  29. #include "v2g_serviceDataTypes.h"
  30. #include "EXITypes.h"
  31. struct uniqueIDPath
  32. {
  33. int id[10];
  34. size_t pos;
  35. };
  36. struct EXIService
  37. {
  38. /* in-/ out-stream */
  39. bitstream_t inStream;
  40. bitstream_t outStream;
  41. /* EXI */
  42. exi_state_t stateDecode;
  43. exi_state_t stateEncode;
  44. exi_event_t event;
  45. eqname_t eqn;
  46. exi_value_t val;
  47. /* v2g message data structure */
  48. struct EXIDocumentType exiMsg;
  49. /* unique id for ambiguous elements */
  50. struct uniqueIDPath idPath;
  51. /* error code */
  52. uint8_t errorCode;
  53. /* offset for transported header data */
  54. uint16_t transportHeaderOffset;
  55. };
  56. enum responseMessages
  57. {
  58. has_to_be_filled
  59. };
  60. /* define error codes (TODO: define precise error codes) */
  61. #define EXI_NON_VALID_MESSAGE 0x01
  62. #define EXI_SERIALIZATION_FAILED 0x02
  63. #define EXI_UNKNOWN_ERROR 0xFF
  64. #endif /* EXI_SERVICE_H_ */
  65. #ifdef __cplusplus
  66. }
  67. #endif