main.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616
  1. /*
  2. * Config.h
  3. *
  4. * Created on: 2020年01月15日
  5. * Author: Eason Yang
  6. */
  7. #ifndef CONFIG_MAIN_H_
  8. #define CONFIG_MAIN_H_
  9. #include <sys/types.h>
  10. #include <sys/stat.h>
  11. #include <sys/time.h>
  12. #include <sys/timeb.h>
  13. #include <sys/types.h>
  14. #include <sys/ioctl.h>
  15. #include <sys/socket.h>
  16. #include <sys/ipc.h>
  17. #include <sys/shm.h>
  18. #include <sys/mman.h>
  19. #include <linux/wireless.h>
  20. #include <arpa/inet.h>
  21. #include <netinet/in.h>
  22. #include <dirent.h>
  23. #include <unistd.h>
  24. #include <stdarg.h>
  25. #include <stdio.h> /*標準輸入輸出定義*/
  26. #include <stdlib.h> /*標準函數庫定義*/
  27. #include <unistd.h> /*Unix 標準函數定義*/
  28. #include <fcntl.h> /*檔控制定義*/
  29. #include <termios.h> /*PPSIX 終端控制定義*/
  30. #include <errno.h> /*錯誤號定義*/
  31. #include <errno.h>
  32. #include <string.h>
  33. #include <time.h>
  34. #include <ctype.h>
  35. #include <ifaddrs.h>
  36. #include <stdbool.h>
  37. #include <stddef.h>
  38. #include <stdint.h>
  39. #include <sqlite3.h>
  40. //===================================
  41. // Define CP State constant
  42. //===================================
  43. #define CP_STATE_UNKNOWN 0
  44. #define CP_STATE_A 1
  45. #define CP_STATE_B 2
  46. #define CP_STATE_C 3
  47. #define CP_STATE_D 4
  48. #define CP_STATE_E 5
  49. #define CP_STATE_F 6
  50. //===================================
  51. // Define CCS CP State constant
  52. //===================================
  53. #define CCS_CP_STATE_UNKNOWN 0
  54. #define CCS_CP_STATE_A 1 //A (12V, no PWM)
  55. #define CCS_CP_STATE_B1 2 //B1 (9V, no PWM)
  56. #define CCS_CP_STATE_B2 3 //B2 (9V, with PWM)
  57. #define CCS_CP_STATE_C 4 //C (6V, with PWM)
  58. #define CCS_CP_STATE_D 5 //D (3V, with PWM)
  59. #define CCS_CP_STATE_E 6 //E (0V, no PWM)
  60. #define CCS_CP_STATE_F 7 //F (-12V, no PWM)
  61. #define CCS_CP_STATE_G 8 //G (>12V)
  62. #define CCS_CP_STATE_H 9 //H (<12V)
  63. //===================================
  64. // Define start mode constant
  65. //===================================
  66. #define START_METHOD_FREE 0
  67. #define START_METHOD_RFID 1
  68. #define START_METHOD_BACKEND 2
  69. #define START_METHOD_BLE 3
  70. //===================================
  71. // Define Speaker type constant
  72. //===================================
  73. #define SPEAKER_STOP 0
  74. #define SPEAKER_ALWAYS_ON 1
  75. #define SPEAKER_SHORT 2
  76. #define SPEAKER_LONG 3
  77. #define SPEAKER_INTERVAL_SHORT 4
  78. #define SPEAKER_INTERVAL_LONG 5
  79. #define SPEAKER_INTERVAL_3COUNT 6
  80. //===================================
  81. // Define Alarm code constant
  82. //===================================
  83. #define ALARM_L1_OVER_VOLTAGE 0x00000001
  84. #define ALARM_L1_UNDER_VOLTAGE 0x00000002
  85. #define ALARM_L1_OVER_CURRENT 0x00000004
  86. #define ALARM_OVER_TEMPERATURE 0x00000008
  87. #define ALARM_GROUND_FAIL 0x00000010
  88. #define ALARM_CP_ERROR 0x00000020
  89. #define ALARM_CURRENT_LEAK_AC 0x00000040
  90. #define ALARM_CURRENT_LEAK_DC 0x00000080
  91. #define ALARM_MCU_TESTFAIL 0x00000100
  92. #define ALARM_HANDSHAKE_TIMEOUT 0x00000200
  93. #define ALARM_EMERGENCY_STOP 0x00000400
  94. #define ALARM_RELAY_WELDING 0x00000800
  95. #define ALARM_LEAK_MODULE_FAIL 0x00001000
  96. #define ALARM_SHUTTER_FAULT 0x00002000
  97. #define ALARM_LOCKER_FAULT 0x00004000
  98. #define ALARM_POWER_DROP 0x00008000
  99. #define ALARM_CIRCUIT_SHORT 0x00010000
  100. #define ALARM_ROTATORY_SWITCH_FAULT 0x00020000
  101. #define ALARM_RELAY_DRIVE_FAULT 0x00040000
  102. #define ALARM_BLE_MODULE_BROKEN 0x00080000
  103. #define ALARM_L2_OVER_VOLTAGE 0x00100000
  104. #define ALARM_L3_OVER_VOLTAGE 0x00200000
  105. #define ALARM_L2_UNDER_VOLTAGE 0x00400000
  106. #define ALARM_L3_UNDER_VOLTAGE 0x00800000
  107. #define ALARM_L2_OVER_CURRENT 0x01000000
  108. #define ALARM_L3_OVER_CURRENT 0x02000000
  109. //===================================
  110. // Define Led constant
  111. //===================================
  112. #define LED_ACTION_INIT 0
  113. #define LED_ACTION_IDLE 1
  114. #define LED_ACTION_AUTHED 2
  115. #define LED_ACTION_CONNECTED 3
  116. #define LED_ACTION_CHARGING 4
  117. #define LED_ACTION_STOP 5
  118. #define LED_ACTION_ALARM 6
  119. #define LED_ACTION_MAINTAIN 7
  120. #define LED_ACTION_RFID_PASS 8
  121. #define LED_ACTION_RFID_FAIL 9
  122. #define LED_ACTION_BLE_CONNECT 10
  123. #define LED_ACTION_BLE_DISABLE 11
  124. #define LED_ACTION_DEBUG 12
  125. #define LED_ACTION_ALL_OFF 13
  126. #define LED_RELAY_ON 14
  127. #define LED_RELAY_OFF 15
  128. #define LED_ACTION_HANDSHAKE_FAIL 16
  129. #define LED_ACTION_INTERNET_DISCONNECT 17
  130. //=================================
  131. //CCS related define
  132. //=================================
  133. #define CCS_PWM_DUTY_CP_STAT_E 0
  134. #define CCS_PWM_DUTY_5 5
  135. #define CCS_PWM_DUTY_100 100
  136. #define HANDSHAKE_DUTY_5 1
  137. #define HANDSHAKE_CCS 2
  138. #define HANDSHAKE_CP_STATE_E 3
  139. #define HANDSHAKE_SET_MAX_CURRENT 4
  140. #define HANDSHAKE_NORMAL_CP 5
  141. #define HANDSHAKE_NORMAL_CCS 6
  142. #define CHARGING_MODE_BS 0
  143. #define CHARGING_MODE_HLC 1
  144. #define DEBUG_INFO(format, args...) StoreLogMsg("[%s:%d][%s][Info] "format, __FILE__, __LINE__, __FUNCTION__, ##args)
  145. #define DEBUG_WARN(format, args...) StoreLogMsg("[%s:%d][%s][Warn] "format, __FILE__, __LINE__, __FUNCTION__, ##args)
  146. #define DEBUG_ERROR(format, args...) StoreLogMsg("[%s:%d][%s][Error] "format, __FILE__, __LINE__, __FUNCTION__, ##args)
  147. extern int StoreLogMsg(const char *fmt, ...);
  148. //============================================================
  149. // Private shared memory key define
  150. //============================================================
  151. #define ShmChargerKey 2001
  152. typedef struct Verion
  153. {
  154. char Version_FW[32];
  155. char Version_HW[32];
  156. }Ver;
  157. typedef struct PRESENTINPUTVOLTAGE
  158. {
  159. unsigned char inputType; // 0x00: Line to Line 0x01: Line to Neutral
  160. double L1N_L12;
  161. double L2N_L23;
  162. double L3N_L31;
  163. }PresentInputVoltage;
  164. typedef struct PRESENTOUTPUTVOLTAGE
  165. {
  166. double behindFuse_Voltage_C1;
  167. double behindRelay_Voltage_C1;
  168. double behindFuse_Voltage_C2;
  169. double behindRelay_Voltage_C2;
  170. }PresentOutputVoltage;
  171. typedef struct FANSPEED
  172. {
  173. unsigned short int speed[4];
  174. }FanSpeed;
  175. typedef struct TEMPERATURE
  176. {
  177. unsigned char point[8];
  178. }Temperature;
  179. typedef struct AUXPOWER
  180. {
  181. unsigned char voltage[8];
  182. }AuxPower;
  183. typedef struct RELAY
  184. {
  185. unsigned char relay_status[2][8];
  186. }Relay;
  187. typedef struct GFD
  188. {
  189. unsigned short int adc_value_positive[2];
  190. unsigned short int adc_value_negative[2];
  191. }Gfd;
  192. typedef struct GPIO_IN
  193. {
  194. unsigned char AC_Connector;
  195. unsigned char AC_MainBreaker;
  196. unsigned char SPD;
  197. unsigned char Door_Open;
  198. unsigned char GFD[2];
  199. unsigned char Button[2];
  200. unsigned char Button_Emergency;
  201. }Gpio_in;
  202. typedef struct GPIO_OUT
  203. {
  204. unsigned char AC_Connector;
  205. unsigned char Button_LED[2];
  206. unsigned char System_LED[4];
  207. }Gpio_out;
  208. typedef struct ALARM_LOG
  209. {
  210. unsigned char logArea;
  211. unsigned int alarmIndex;
  212. unsigned char log[8];
  213. }Alarm_Log;
  214. typedef struct BLE_CONFIG_DATA
  215. {
  216. unsigned char isLogin:1;
  217. unsigned char isRequestStart:1;
  218. unsigned char isRequestStop:1;
  219. }Ble_Config_Data;
  220. typedef struct BLE_LONGIN_CENTRAL_ID
  221. {
  222. unsigned char id[32];
  223. }Ble_Login_Central_Id;
  224. typedef struct RTC
  225. {
  226. unsigned short int year;
  227. unsigned char month;
  228. unsigned char day;
  229. unsigned char hour;
  230. unsigned char min;
  231. unsigned char sec;
  232. }Rtc;
  233. typedef struct PRESENTOUTPUTCURRENT
  234. {
  235. double L1N_L12[2];
  236. double L2N_L23[2];
  237. double L3N_L31[2];
  238. }Presentoutputcurrent;
  239. typedef struct AC_PRIMARY_MCU
  240. {
  241. unsigned char cp_state;
  242. unsigned int current_limit;
  243. float cp_voltage_positive;
  244. float cp_voltage_negtive;
  245. unsigned char locker_state;
  246. unsigned char relay_state;
  247. unsigned char shutter_state;
  248. unsigned char meter_state;
  249. unsigned char pp_state;
  250. unsigned char rating_current;
  251. unsigned char rotatory_switch;
  252. Relay relayState;
  253. }Ac_Primary_Mcu;
  254. typedef struct AC_PRIMARY_MCU_ALARM
  255. {
  256. union
  257. {
  258. unsigned long InputAlarmCode;
  259. struct
  260. {
  261. unsigned long OVP_L1:1;
  262. unsigned long UVP_L1:1;
  263. unsigned long OCP_L1:1;
  264. unsigned long OTP:1;
  265. unsigned long gmi_fault:1;
  266. unsigned long cp_fault:1;
  267. unsigned long ac_leak:1;
  268. unsigned long dc_leak:1;
  269. unsigned long mcu_selftest_fail:1;
  270. unsigned long handshaking_timeout:1;
  271. unsigned long emergency_stop:1;
  272. unsigned long relay_welding:1;
  273. unsigned long leak_module_fail:1;
  274. unsigned long shutter_fault:1;
  275. unsigned long locker_fault:1;
  276. unsigned long power_drop:1;
  277. unsigned long circuit_short:1;
  278. unsigned long set_circuit:1;
  279. unsigned long relay_drive_fault:1;
  280. unsigned long comm_timeout:1;
  281. unsigned long OVP_L2:1;
  282. unsigned long UVP_L2:1;
  283. unsigned long OCP_L2:1;
  284. unsigned long OVP_L3:1;
  285. unsigned long UVP_L3:1;
  286. unsigned long OCP_L3:1;
  287. }bits;
  288. };
  289. }Ac_Primary_Mcu_Alarm;
  290. typedef struct AC_PRIMARY_MCU_LED
  291. {
  292. unsigned char mode;
  293. unsigned long alarm_code;
  294. }Ac_Primary_Mcu_Led;
  295. typedef struct EVSE_ID
  296. {
  297. unsigned char model_name[14];
  298. unsigned char serial_number[12];
  299. }Evse_Id;
  300. typedef struct AC_PRIMARY_MCU_CP_PWM_DUTY
  301. {
  302. unsigned int max_current;
  303. }Ac_Primary_Mcu_Cp_Pwm_Duty;
  304. typedef struct LEGACY_REQUEST
  305. {
  306. unsigned char isLegacyRequest:1;
  307. uint8_t isRelayOn:1;
  308. }Legacy_Request;
  309. typedef struct POWER_CONSUMPTION
  310. {
  311. uint32_t power_consumption;
  312. uint32_t power_consumption_at_start;
  313. }Power_Consumption;
  314. typedef struct MCU_OP_FLAG
  315. {
  316. unsigned char isSetModePass:1;
  317. unsigned char isSetSerialNumberPass:1;
  318. unsigned char isSetModelNamePass:1;
  319. unsigned char isReadFwVerPass:1;
  320. unsigned char isMcuUpgradeReq:1;
  321. unsigned char isSetCpPwmDuty:1;
  322. }Mcu_Op_Flag;
  323. typedef struct SYSTEM_ALARM_CODE
  324. {
  325. unsigned long SystemAlarmCode;
  326. }System_Alarm_Code;
  327. typedef struct OTHER_ALARM_CODE
  328. {
  329. unsigned long isHandshakingTimeOut:1;
  330. unsigned long isDcLeakage:1;
  331. unsigned long isACLeakage:1;
  332. }Other_Alarm_Code;
  333. typedef struct PILOT_VOLTAGE
  334. {
  335. float PilotVoltagePositive;
  336. float PilotVoltageNegative;
  337. }Pilot_Voltage;
  338. typedef struct FW_UPGRADE_INFO
  339. {
  340. int fwType;
  341. char modelName[17];
  342. char location[384];
  343. }Fw_Upgrade_Info;
  344. typedef struct GUN_PLUGIN_TIMES
  345. {
  346. uint32_t GunPluginTimes;
  347. }Gun_Plugin_Times;
  348. typedef struct MCU_RESET_REQUEST
  349. {
  350. unsigned char isMcuResetRequest:1;
  351. }Mcu_Reset_Request;
  352. typedef struct TIMEOUT_SPEC
  353. {
  354. int Setting_Timeout_Spec;
  355. int Present_Timeout_Spec;
  356. }Timeout_Spec;
  357. typedef struct SET_BREATHE_LED_TIMING
  358. {
  359. uint16_t set_Led_Action_Connected_Fade_In;
  360. uint16_t set_Led_Action_Connected_Fade_Out;
  361. uint16_t set_Led_Action_Authed_Fade_In;
  362. uint16_t set_Led_Action_Authed_Fade_Out;
  363. uint16_t Set_Led_Action_Chaging_Fade_In;
  364. uint16_t set_Led_Action_Chaging_Fade_Out;
  365. }Set_Breathe_Led_Timing;
  366. typedef struct SET_LED_BRIGHTNESS
  367. {
  368. uint8_t sector_1; // 0~1 AM and 1~2 AM
  369. uint8_t sector_2; // 2~3 AM and 3~4 AM
  370. uint8_t sector_3; // 4~5 AM and 5~6 AM
  371. uint8_t sector_4; // 6~7 AM and 7~8 AM
  372. uint8_t sector_5; // 8~9 AM and 9~10 AM
  373. uint8_t sector_6; // 10~11 AM and 11~12 AM
  374. uint8_t sector_7; // 12~13 PM and 13~14 PM
  375. uint8_t sector_8; // 14~15 PM and 15~16 PM
  376. uint8_t sector_9; // 16~17 PM and 17~18 PM
  377. uint8_t sector_10; // 18~19 PM and 19~20 PM
  378. uint8_t sector_11; // 20~21 PM and 21~22 PM
  379. uint8_t sector_12; // 22~23 PM and 23~24 PM
  380. }Set_Led_Brightness;
  381. typedef struct CCS_INFO
  382. {
  383. uint8_t BatteryChargeType; /*0x00: AC charging, 0x01: DC charging*/
  384. uint8_t PresentMsgFlowStatus;
  385. /* ISO15118_2018
  386. 0: Idle(wait B2 state),
  387. 1: CM_SLAC_PARM.REQ,
  388. 2: CM_SLAC_PARM.CNF,
  389. 3: CM_START_ATTEN_CHAR.IND
  390. 4: CM_MNBC_SOUND.IND,
  391. 5: CM_ATTEN_CHAR.IND,
  392. 6: CM_ATTEN_CHAR.RSP,
  393. 7: CM_VALIDATE.REQ
  394. 8: CM_VALIDATE.CNF,
  395. 9: CM_SLAC_MATCH.REQ,
  396. 10: CM_SLAC_MATCH.CNF,
  397. 11: CM_AMP_MAP.REQ
  398. 12: CM_AMP_MAP.CNF,
  399. 13: SLACC/SDP/TCP connection,
  400. 16: SupportedAppProtocolRequest,
  401. 17: SupportedAppProtocolResponse,
  402. 18: SessionSetupRequest
  403. 19: SessionSetupResponse,
  404. 20: ServiceDiscoveryRequest,
  405. 21: ServiceDiscoveryResponse
  406. 22: ServiceDetailRequest,
  407. 23: ServiceDetailResponse
  408. 24:ServiceAndPaymentSelectionRequest/ServiceSelectionRequest,
  409. 25: ServiceAndPaymentSelectionResponse/ServiceSelectionResponse
  410. 26: PaymentDetailsRequest/IdentificationDetailsRequest;,
  411. 27: PaymentDetailsResponse/IdentificationDetailsResponse,
  412. 28: AuthorizationRequest,
  413. 29: AuthorizationResponse,
  414. 30: CertificateUpdateRequest,
  415. 31: CertificateUpdateResponse,
  416. 32:CertificateInstallationRequest,
  417. 33: CertificateInstallationResponse
  418. 34: ChargeParameterDiscoveryRequest,
  419. 35: ChargeParameterDiscoveryResponse
  420. 36: CableCheckRequest,
  421. 37: CableCheckResponse,
  422. 38: PreChargeRequest,
  423. 39: PreChargeResponse
  424. 40: PowerDeliveryRequest start,
  425. 41: PowerDeliveryResponse start,
  426. 42: ChargingStatusRequest,
  427. 43: ChargingStatusResponse
  428. 44:CurrentDemandRequest,
  429. 45:CurrentDemandResponse,
  430. 46:MeteringReceiptRequest,
  431. 47: MeteringReceiptResponse
  432. 48: PowerDeliveryRequest end,
  433. 49: PowerDeliveryRequest end,
  434. 50: WeldingDetectionRequest,
  435. 51: WeldingDetectionResponse,
  436. 52: SessionStopRequest,
  437. 53: SessionStopResponse
  438. 253: Performance Timeout,
  439. 254: Sequence Timeout,
  440. 255: Fault
  441. */
  442. float ConnectorTemperature1; /*unit: 1°C*/
  443. float ConnectorTemperature2; /*unit: 1°C*/
  444. uint16_t ChargingRemainTime; /*0x0000: 0 sec ~ 0xFFFF: 65535 sec, unit: 1 second*/
  445. float TotalBatteryCapacity; /*unit: Wh*/
  446. float BatteryMaximumVoltage; /*unit: 1 volt*/
  447. float BatteryMaximumCurrent; /*unit: 1 amp*/
  448. uint8_t EVCCID[8];
  449. uint8_t EVSEID[40];
  450. uint8_t CCSLibRev[32];
  451. uint8_t EVSEModelName[32];
  452. uint32_t CSUAlarmStatusCode;
  453. uint16_t CCSAlarmStatusCode;
  454. uint8_t PaymentOption; /* 0x00 EIM, 0x01 Pnc */
  455. float EVSEMaxCurrent; /*unit: 1 amp*/
  456. float EVSEMinCurrent; /*unit: 1 amp*/
  457. float EVSENominalVoltage; /*unit: 1 volt*/
  458. uint8_t MeterID[32]; /*unit: 1 amp*/
  459. float MeterReadingValue; /*unit: Wh*/
  460. uint8_t EVOperation; /*0:Charge, 1:Discharge*/
  461. uint8_t EVChargeProgress; /*0: Stop
  462. 1: Start
  463. 2: Renegotiate
  464. 3: Standby */
  465. uint8_t SetCPPWMDuty; /*unit: 1%
  466. 0: 0%
  467. 5: 5%
  468. 100: 100%*/
  469. uint8_t SetCP2StateE; /*0:disable, 1:enable*/
  470. uint8_t CPPresentPWMDuty; /*unit:1%*/
  471. uint8_t CPPresentState; /*1: A (12V, no PWM)
  472. 2: B1 (9V, no PWM)
  473. 3: B2 (9V, with PWM)
  474. 4: C (6V, with PWM)
  475. 5: D (3V, with PWM)
  476. 6: E (0V, no PWM)
  477. 7: F (-12V, no PWM)
  478. 8: G (>12V)
  479. 9: H (<12V)*/
  480. float CPPositiveVoltage; /*uint: 1V*/
  481. float CPNegativeVoltage; /*uint: 1V*/
  482. uint16_t ChargingPermission:1; /*0x00: Not ready yet, stay in idle mode or go into terminating process.
  483. 0x01: start charging process*/
  484. uint16_t ConnectorLockerStatus:1; /*0x00: released
  485. 0x01: locked*/
  486. uint16_t RcdStatus:1; /* 0x00 no error
  487. 0x01 an error */
  488. uint16_t TempFlag3:1;
  489. uint16_t TempFlag4:1;
  490. uint16_t TempFlag5:1;
  491. uint16_t TempFlag6:1;
  492. uint16_t TempFlag7:1;
  493. uint16_t TempFlag8:1;
  494. uint16_t TempFlag9:1;
  495. uint16_t TempFlag10:1;
  496. uint16_t TempFlag11:1;
  497. uint16_t TempFlag12:1;
  498. uint16_t TempFlag13:1;
  499. uint16_t TempFlag14:1;
  500. uint16_t TempFlag15:1;
  501. }Ac_Ccs_Info;
  502. typedef struct GUN_INFO
  503. {
  504. Ver ver;
  505. PresentInputVoltage inputVoltage;
  506. Presentoutputcurrent outputCurrent;
  507. Temperature temperature;
  508. Ble_Config_Data bleConfigData;
  509. Ble_Login_Central_Id bleLoginCentralId;
  510. Rtc rtc;
  511. Ac_Primary_Mcu primaryMcuState;
  512. Ac_Primary_Mcu_Alarm primaryMcuAlarm;
  513. Ac_Primary_Mcu_Led primaryMcuLed;
  514. Mcu_Op_Flag mcuFlag;
  515. Power_Consumption powerConsumption;
  516. Legacy_Request legacyRequest;
  517. System_Alarm_Code systemAlarmCode;
  518. Ac_Primary_Mcu_Cp_Pwm_Duty primaryMcuCp_Pwn_Duty;
  519. Other_Alarm_Code otherAlarmCode;
  520. Pilot_Voltage PilotVoltage;
  521. Gun_Plugin_Times gunPluginTimes;
  522. Mcu_Reset_Request mcuResetRequest;
  523. Set_Breathe_Led_Timing setBreatheLedTiming;
  524. Set_Led_Brightness setLedBrightness;
  525. Ac_Ccs_Info acCcsInfo;
  526. uint8_t ccsHandshakeState;
  527. uint8_t chargingMode;
  528. uint16_t targetCurrent;
  529. uint16_t isAuthPassEnd:1;
  530. uint16_t rfidReq:1;
  531. uint16_t isGunPlugged:1;
  532. uint16_t isInitialPass:1;
  533. uint16_t isSetBreatheLedTiming:1;
  534. uint16_t isSetLedBrightness:1;
  535. uint16_t isUnlockerConnetor:1;
  536. uint16_t isOperactive:1;
  537. }Gun_Info;
  538. struct Charger
  539. {
  540. Ver ver;
  541. Evse_Id evseId;
  542. Gun_Info gun_info[2];
  543. Fw_Upgrade_Info fwUpgradeInfo;
  544. Timeout_Spec timeoutSpec;
  545. uint8_t gun_selectd;
  546. uint8_t speaker_type;
  547. uint8_t isSpeakerOn:1;
  548. uint8_t isUpdateSuccess:1;
  549. };
  550. #endif /* CONFIG_MAIN_H_ */