SelectGun.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. #ifndef _SELECT_GUN_H_
  2. #define _SELECT_GUN_H_
  3. #include <stdint.h>
  4. //------------------------------------------------------------------------------
  5. //--- //For Audi for Audi customization ---
  6. //------------------------------------------------------------------------------
  7. #define ShmSelectGunInfoKey (1014)
  8. #define SEL_GUN_RELEASE (0x00)
  9. #define SEL_GUN_CONFIRM (0x01)
  10. #define SEL_GUN_ATHOR (0x02)
  11. #define SEL_GUN_PLUG_IT (0x03)
  12. //#define SEL_GUN_CHARGING (0x04)
  13. //#define SEL_GUN_CHARGING_COMP (0x05)
  14. #define LEFT_GUN_NUM (0)
  15. #define RIGHT_GUN_NUM (1)
  16. #define SEL_GUN_TIMEOUT (120)
  17. #define DESTROY_ALL_SEL (0x03)
  18. #define FAIL_BALANCE_PRICES (-65535.00)
  19. //------------------------------------------------------------------------------
  20. //--- remote control ---
  21. //------------------------------------------------------------------------------
  22. //#define RT_NON_ACTION 0x00
  23. //#define RT_HARDWARE_REBOOT 0x01
  24. //#define RT_SOFTWARE_RESTART 0x02
  25. //------------------------------------------------------------------------------
  26. //--- power cabinet Ethernet device status ---
  27. //------------------------------------------------------------------------------
  28. #define DEV_ST_DISABLE 0x00
  29. #define DEV_ST_ENABLE_USE 0x01
  30. #define DEV_ST_ENABLE_NO_USE 0x02
  31. #define EV_BOARD_STOP_CHARGING 1
  32. #define POWER_CABINET_STOP_CHARGING 2
  33. //------------------------------------------------------------------------------
  34. typedef struct StEthDevStatus {
  35. uint8_t Backend;
  36. uint8_t Ethernet;
  37. uint8_t Wifi;
  38. uint8_t FourG;
  39. } EthDevStatus;
  40. typedef struct StSelGunInfo {
  41. uint8_t LeftGun;
  42. uint8_t RightGun;
  43. uint8_t Reserved[2];
  44. } SelGunInfo;
  45. typedef struct StPricesInfo {
  46. //uint8_t Currency;
  47. float UserPrices; //unit = 0.01 dollar, value / 100
  48. //float TotalCost; //unit = 0.01 dollar, value / 100
  49. float Balance; //unit = 0.01 dollar, value / 100
  50. //float DefaultPrices; //unit = 0.01 dollar, value / 100
  51. float Discount;
  52. int TransactionId;
  53. float EnergyCost;
  54. float ParkingFee;
  55. float RemainAmount;
  56. } PricesInfo;
  57. //typedef struct StOperativeInfo {
  58. // uint8_t ChangeReq;
  59. // uint8_t ConnectorID;
  60. // uint8_t AvailabilityReq;
  61. // uint8_t Reserved;
  62. //} OperativeInfo;
  63. //typedef struct StStartCharge {
  64. // uint8_t ConnectorID;
  65. // uint8_t Status;
  66. // uint8_t Reserved[2];
  67. //} StartCharge;
  68. typedef struct StRemoteSetup {
  69. //uint8_t Execution;
  70. //uint8_t BtnStopCharging;
  71. uint16_t ConnectionTimeout;
  72. //float DefaultPrices;
  73. //OperativeInfo Operative;
  74. //StartCharge StartCharge;
  75. uint8_t Reserved[2];
  76. } RemoteSetup;
  77. typedef struct StAudiCustInfo {
  78. SelGunInfo SelGunInfo;
  79. PricesInfo PricesInfo[2];
  80. RemoteSetup RemoteSetup;
  81. EthDevStatus EthDevStatus;
  82. uint8_t AuthorStateFromCabinet[2];
  83. uint8_t WaitDoCommPermission[2]; //等待主櫃回覆再進入充電檢測
  84. //uint8_t Reserved; //保留
  85. } SelectGunInfo;
  86. //------------------------------------------------------------------------------
  87. //int WaitAuthorPageState(void);
  88. //void destroySelGun(uint8_t curGun);
  89. //int waitRightGunPlugIt(uint8_t curGun);
  90. //int waitLeftGunPlugIt(uint8_t curGun);
  91. //void setSelGunWaitToAuthor(uint8_t curSel);
  92. //int getConfirmSelectedGun(uint8_t curSel);
  93. //void confirmSelGun(uint8_t selGun);
  94. #endif /* _SELECT_GUN_H_ */