ShareMemory.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. #ifndef ShareMemory_H
  2. #define ShareMemory_H
  3. struct AuthorizeRequest
  4. {
  5. unsigned char IdTag[20];
  6. };
  7. struct BootNotificationRequest{
  8. unsigned char CpVendor[20]; //chargePointVendor //mandatory
  9. unsigned char CpModel[20]; //chargePointModel //mandatory
  10. unsigned char CpSN[25]; //chargePointSerialNumber
  11. unsigned char CbSN[25]; //chargeBoxSerialNumber
  12. unsigned char CpFwVersion[50]; //firmwareVersion
  13. unsigned char CpIccid[20]; //iccid
  14. unsigned char CpImsi[20]; //imsi
  15. unsigned char CpMeterType[25]; //meterType
  16. unsigned char CpMeterSerialNumber[25]; //meterSerialNumber
  17. };
  18. struct DiagnosticsStatusNotificationRequest{
  19. unsigned char Status[16]; //Idle,Uploaded,UploadFailed,Uploading
  20. };
  21. struct StartTransactionRequest
  22. {
  23. int ConnectorId;
  24. unsigned char IdTag[20];
  25. int MeterStart;
  26. int ReservationId;
  27. unsigned char Timestamp[28];
  28. };
  29. struct StopTransactionRequest
  30. {
  31. unsigned char IdTag[20];
  32. int MeterStop;
  33. unsigned char Timestamp[28];
  34. int TransactionId;
  35. unsigned char StopReason; /* "EmergencyStop",
  36. "EVDisconnected",
  37. "HardReset",
  38. "Local",
  39. "Other",
  40. "PowerLoss",
  41. "Reboot",
  42. "Remote",
  43. "SoftReset",
  44. "UnlockCommand",
  45. "DeAuthorized"
  46. */
  47. struct StructMeterValue *TransactionData;
  48. };
  49. struct StatusNotificationRequest
  50. {
  51. int ConnectorId;
  52. unsigned char ErrorCode; /* "ConnectorLockFailure",
  53. "EVCommunicationError",
  54. "GroundFailure",
  55. "HighTemperature",
  56. "InternalError",
  57. "LocalListConflict",
  58. "NoError",
  59. "OtherError",
  60. "OverCurrentFailure",
  61. "PowerMeterFailure",
  62. "PowerSwitchFailure",
  63. "ReaderFailure",
  64. "ResetFailure",
  65. "UnderVoltage",
  66. "OverVoltage",
  67. "WeakSignal"
  68. */
  69. unsigned char Info[50];
  70. unsigned char Status; /* "Available",
  71. "Preparing",
  72. "Charging",
  73. "SuspendedEVSE",
  74. "SuspendedEV",
  75. "Finishing",
  76. "Reserved",
  77. "Unavailable",
  78. "Faulted"
  79. */
  80. unsigned char Timestamp[28];
  81. unsigned char VendorId[256];
  82. unsigned char VendorErrorCode[50];
  83. };
  84. struct AuthorizeResponse{
  85. unsigned char ExpiryDate[28];
  86. unsigned char ParentIdTag[20];
  87. unsigned char Status[16]; //Accepted, Blocked, Expired, Invalid, ConcurrentTx
  88. };
  89. struct BootNotificationResponse{
  90. unsigned char ResponseStatus[16]; //Accepted, Pending, Rejected
  91. unsigned char ResponseCurrentTime[28]; //currentTime //mandatory
  92. int ResponseHeartbeatInterval; //interval //mandatory
  93. };
  94. struct DataTransferResponse
  95. {
  96. unsigned char ResponseStatus[18]; //Accepted, Rejected,UnknownMessageId,UnknownVendorId
  97. unsigned char ResponseData[256];
  98. };
  99. struct HeartbeatResponse
  100. {
  101. unsigned char ResponseCurrentTime[28];
  102. };
  103. struct StartTransactionResponse
  104. {
  105. unsigned char ExpiryDate[28];
  106. unsigned char ParentIdTag[20];
  107. unsigned char Status[16]; //Accepted, Blocked, Expired, Invalid, ConcurrentTx
  108. int ResponseTransactionId;
  109. };
  110. struct StopTransactionResponse
  111. {
  112. unsigned char ExpiryDate[28];
  113. unsigned char ParentIdTag[20];
  114. unsigned char Status[16]; //Accepted, Blocked, Expired, Invalid, ConcurrentTx
  115. };
  116. //==========================================
  117. // Init all share memory
  118. //==========================================
  119. int InitShareMemory();
  120. int ProcessShareMemory();
  121. void CheckSystemValue(void);
  122. #endif