v2g_service.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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.3
  21. * @contact Joerg.Heuer@siemens.com
  22. *
  23. ********************************************************************/
  24. #ifdef __cplusplus
  25. extern "C" {
  26. #endif
  27. #ifndef V2G_SERVICE_H_
  28. #define V2G_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 v2gService
  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 AnonType_V2G_Message v2gMsg;
  49. /* unique id for ambiguous elements */
  50. struct uniqueIDPath idPath;
  51. /* error code */
  52. uint8_t errorCode;
  53. /* offset for transport header data */
  54. uint16_t transportHeaderOffset;
  55. };
  56. /* define error codes (TODO: define precise error codes) */
  57. #define V2G_NON_VALID_MESSAGE 0x01
  58. #define V2G_SERIALIZATION_FAILED 0x02
  59. #define V2G_UNKNOWN_ERROR 0xFF
  60. #endif /* V2G_SERVICE_H_ */
  61. #ifdef __cplusplus
  62. }
  63. #endif