SelectGun.h 3.9 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. #define DISPENSER_STOP_CHARGING 3
  34. //------------------------------------------------------------------------------
  35. typedef struct StEthDevStatus {
  36. uint8_t Backend;
  37. uint8_t Ethernet;
  38. uint8_t Wifi;
  39. uint8_t FourG;
  40. } EthDevStatus;
  41. typedef struct StSelGunInfo {
  42. uint8_t LeftGun;
  43. uint8_t RightGun;
  44. uint8_t Reserved[2];
  45. } SelGunInfo;
  46. typedef struct StPricesInfo {
  47. //uint8_t Currency;
  48. float UserPrices; //unit = 0.01 dollar, value / 100
  49. //float TotalCost; //unit = 0.01 dollar, value / 100
  50. float Balance; //unit = 0.01 dollar, value / 100
  51. //float DefaultPrices; //unit = 0.01 dollar, value / 100
  52. float Discount;
  53. int TransactionId;
  54. float EnergyCost;
  55. float ParkingFee;
  56. float RemainAmount;
  57. } PricesInfo;
  58. //typedef struct StOperativeInfo {
  59. // uint8_t ChangeReq;
  60. // uint8_t ConnectorID;
  61. // uint8_t AvailabilityReq;
  62. // uint8_t Reserved;
  63. //} OperativeInfo;
  64. //typedef struct StStartCharge {
  65. // uint8_t ConnectorID;
  66. // uint8_t Status;
  67. // uint8_t Reserved[2];
  68. //} StartCharge;
  69. typedef struct StRemoteSetup {
  70. //uint8_t Execution;
  71. //uint8_t BtnStopCharging;
  72. uint16_t ConnectionTimeout;
  73. //float DefaultPrices;
  74. //OperativeInfo Operative;
  75. //StartCharge StartCharge;
  76. uint8_t Reserved[2];
  77. } RemoteSetup;
  78. typedef struct StAudiCustInfo {
  79. SelGunInfo SelGunInfo;
  80. PricesInfo PricesInfo[2];
  81. RemoteSetup RemoteSetup;
  82. EthDevStatus EthDevStatus;
  83. uint8_t AuthorStateFromCabinet[2];
  84. uint8_t WaitDoCommPermission[2]; //等待主櫃回覆再進入充電檢測
  85. //uint8_t Reserved; //保留
  86. } SelectGunInfo;
  87. //------------------------------------------------------------------------------
  88. //int WaitAuthorPageState(void);
  89. //void destroySelGun(uint8_t curGun);
  90. //int waitRightGunPlugIt(uint8_t curGun);
  91. //int waitLeftGunPlugIt(uint8_t curGun);
  92. //void setSelGunWaitToAuthor(uint8_t curSel);
  93. //int getConfirmSelectedGun(uint8_t curSel);
  94. //void confirmSelGun(uint8_t selGun);
  95. #endif /* _SELECT_GUN_H_ */