|
@@ -8,38 +8,38 @@
|
|
|
#ifndef CONFIG_MAIN_H_
|
|
|
#define CONFIG_MAIN_H_
|
|
|
|
|
|
-#include <sys/types.h>
|
|
|
-#include <sys/stat.h>
|
|
|
-#include <sys/time.h>
|
|
|
-#include <sys/timeb.h>
|
|
|
-#include <sys/types.h>
|
|
|
-#include <sys/ioctl.h>
|
|
|
-#include <sys/socket.h>
|
|
|
-#include <sys/ipc.h>
|
|
|
-#include <sys/shm.h>
|
|
|
-#include <sys/mman.h>
|
|
|
-#include <linux/wireless.h>
|
|
|
-#include <arpa/inet.h>
|
|
|
-#include <netinet/in.h>
|
|
|
-#include <dirent.h>
|
|
|
-
|
|
|
-#include <unistd.h>
|
|
|
-#include <stdarg.h>
|
|
|
-#include <stdio.h>
|
|
|
-#include <stdlib.h>
|
|
|
-#include <unistd.h>
|
|
|
-#include <fcntl.h>
|
|
|
-#include <termios.h>
|
|
|
-#include <errno.h>
|
|
|
-#include <errno.h>
|
|
|
-#include <string.h>
|
|
|
-#include <time.h>
|
|
|
-#include <ctype.h>
|
|
|
-#include <ifaddrs.h>
|
|
|
-#include <stdbool.h>
|
|
|
-#include <stddef.h>
|
|
|
-#include <stdint.h>
|
|
|
-#include <sqlite3.h>
|
|
|
+#include <sys/types.h>
|
|
|
+#include <sys/stat.h>
|
|
|
+#include <sys/time.h>
|
|
|
+#include <sys/timeb.h>
|
|
|
+#include <sys/types.h>
|
|
|
+#include <sys/ioctl.h>
|
|
|
+#include <sys/socket.h>
|
|
|
+#include <sys/ipc.h>
|
|
|
+#include <sys/shm.h>
|
|
|
+#include <sys/mman.h>
|
|
|
+#include <linux/wireless.h>
|
|
|
+#include <arpa/inet.h>
|
|
|
+#include <netinet/in.h>
|
|
|
+#include <dirent.h>
|
|
|
+
|
|
|
+#include <unistd.h>
|
|
|
+#include <stdarg.h>
|
|
|
+#include <stdio.h>
|
|
|
+#include <stdlib.h>
|
|
|
+#include <unistd.h>
|
|
|
+#include <fcntl.h>
|
|
|
+#include <termios.h>
|
|
|
+#include <errno.h>
|
|
|
+#include <errno.h>
|
|
|
+#include <string.h>
|
|
|
+#include <time.h>
|
|
|
+#include <ctype.h>
|
|
|
+#include <ifaddrs.h>
|
|
|
+#include <stdbool.h>
|
|
|
+#include <stddef.h>
|
|
|
+#include <stdint.h>
|
|
|
+#include <sqlite3.h>
|
|
|
|
|
|
//#define ENABLE_CCS
|
|
|
|
|
@@ -50,52 +50,72 @@
|
|
|
#define ALARM_L1_UNDER_VOLTAGE 0x00000002
|
|
|
#define ALARM_L1_OVER_CURRENT 0x00000004
|
|
|
#define ALARM_OVER_TEMPERATURE 0x00000008
|
|
|
-#define ALARM_GROUND_FAIL 0x00000010
|
|
|
-#define ALARM_CP_ERROR 0x00000020
|
|
|
+#define ALARM_GROUND_FAIL 0x00000010
|
|
|
+#define ALARM_CP_ERROR 0x00000020
|
|
|
#define ALARM_CURRENT_LEAK_AC 0x00000040
|
|
|
#define ALARM_CURRENT_LEAK_DC 0x00000080
|
|
|
|
|
|
-#define ALARM_MCU_TESTFAIL 0x00000100
|
|
|
-#define ALARM_HANDSHAKE_TIMEOUT 0x00000200
|
|
|
+#define ALARM_MCU_TESTFAIL 0x00000100
|
|
|
+#define ALARM_HANDSHAKE_TIMEOUT 0x00000200
|
|
|
#define ALARM_EMERGENCY_STOP 0x00000400
|
|
|
-#define ALARM_RELAY_WELDING 0x00000800
|
|
|
+#define ALARM_RELAY_WELDING 0x00000800
|
|
|
#define ALARM_LEAK_MODULE_FAIL 0x00001000
|
|
|
-#define ALARM_SHUTTER_FAULT 0x00002000
|
|
|
-#define ALARM_LOCKER_FAULT 0x00004000
|
|
|
-#define ALARM_POWER_DROP 0x00008000
|
|
|
-
|
|
|
-#define ALARM_L1_CIRCUIT_SHORT 0x00010000
|
|
|
-#define ALARM_ROTATORY_SWITCH_FAULT 0x00020000
|
|
|
-#define ALARM_RELAY_DRIVE_FAULT 0x00040000
|
|
|
-#define ALARM_BLE_MODULE_BROKEN 0x00080000
|
|
|
-#define ALARM_L2_OVER_VOLTAGE 0x00100000
|
|
|
-#define ALARM_L3_OVER_VOLTAGE 0x00200000
|
|
|
-#define ALARM_L2_UNDER_VOLTAGE 0x00400000
|
|
|
-#define ALARM_L3_UNDER_VOLTAGE 0x00800000
|
|
|
+#define ALARM_SHUTTER_FAULT 0x00002000
|
|
|
+#define ALARM_LOCKER_FAULT 0x00004000
|
|
|
+#define ALARM_POWER_DROP 0x00008000
|
|
|
+
|
|
|
+#define ALARM_L1_CIRCUIT_SHORT 0x00010000
|
|
|
+#define ALARM_ROTATORY_SWITCH_FAULT 0x00020000
|
|
|
+#define ALARM_RELAY_DRIVE_FAULT 0x00040000
|
|
|
+#define ALARM_BLE_MODULE_BROKEN 0x00080000
|
|
|
+#define ALARM_L2_OVER_VOLTAGE 0x00100000
|
|
|
+#define ALARM_L3_OVER_VOLTAGE 0x00200000
|
|
|
+#define ALARM_L2_UNDER_VOLTAGE 0x00400000
|
|
|
+#define ALARM_L3_UNDER_VOLTAGE 0x00800000
|
|
|
|
|
|
#define ALARM_L2_OVER_CURRENT 0x01000000
|
|
|
#define ALARM_L3_OVER_CURRENT 0x02000000
|
|
|
-#define ALARM_L2_CIRCUIT_SHORT 0x04000000
|
|
|
-#define ALARM_L3_CIRCUIT_SHORT 0x08000000
|
|
|
-#define ALARM_METER_TIMEOUT 0x10000000
|
|
|
+#define ALARM_L2_CIRCUIT_SHORT 0x04000000
|
|
|
+#define ALARM_L3_CIRCUIT_SHORT 0x08000000
|
|
|
+#define ALARM_METER_TIMEOUT 0x10000000
|
|
|
#define ALARM_METER_IC_TIMEOUT 0x20000000
|
|
|
#define ALARM_CP_NEG_ERROR 0x40000000
|
|
|
-#define ALARM_QCA_FLASH_FAIL 0x80000000
|
|
|
+#define ALARM_QCA_FLASH_FAIL 0x80000000
|
|
|
|
|
|
//=================================
|
|
|
//CCS related define
|
|
|
//=================================
|
|
|
#define CCS_PWM_DUTY_CP_STATE_F 0
|
|
|
#define CCS_PWM_DUTY_CP_STATE_E 1
|
|
|
-#define CCS_PWM_DUTY_5 5
|
|
|
-#define CCS_PWM_DUTY_100 100
|
|
|
+#define CCS_PWM_DUTY_5 5
|
|
|
+#define CCS_PWM_DUTY_100 100
|
|
|
|
|
|
+//=================================
|
|
|
+//Model Name Byte define .. lwtest
|
|
|
+//=================================
|
|
|
+#define EVSE_OUTPUT_TYPE 0
|
|
|
+#define EVSE_TYPE 1
|
|
|
+#define INPUT_TYPE 2
|
|
|
+#define SAFETY_REGULATION 3
|
|
|
+#define RATING_POWER 4
|
|
|
+#define CONNECTOR_TYPE1 7
|
|
|
+#define CONNECTOR_TYPE2 8
|
|
|
+#define CONNECTOR_TYPE3 9
|
|
|
+#define INTERNET_TYPE 10
|
|
|
+#define GEN_NO 11
|
|
|
+#define VENDOR_CODE 12
|
|
|
+#define MODEL_NAME_LENGTH 14
|
|
|
+
|
|
|
+#define MAX_GUN_NUM 2
|
|
|
+#define AC_OUTPUT_VOL 220
|
|
|
+#define DC_SIMULATE_OUTPUT_VOL 500
|
|
|
+#define SIM_DEVIATION 5
|
|
|
//===================================
|
|
|
// Define CP State constant
|
|
|
//===================================
|
|
|
enum CP_STATE
|
|
|
{
|
|
|
- CP_STATE_UNKNOWN=0,
|
|
|
+ CP_STATE_UNKNOWN = 0,
|
|
|
CP_STATE_A,
|
|
|
CP_STATE_B,
|
|
|
CP_STATE_C,
|
|
@@ -109,16 +129,15 @@ enum CP_STATE
|
|
|
//===================================
|
|
|
enum CCS_CP_STATE
|
|
|
{
|
|
|
- CCS_CP_STATE_UNKNOWN=0,
|
|
|
- CCS_CP_STATE_A, //A (12V, no PWM)
|
|
|
- CCS_CP_STATE_B1, //B1 (9V, no PWM)
|
|
|
- CCS_CP_STATE_B2, //B2 (9V, with PWM)
|
|
|
- CCS_CP_STATE_C, //C (6V, with PWM)
|
|
|
- CCS_CP_STATE_D, //D (3V, with PWM)
|
|
|
- CCS_CP_STATE_E, //E (0V, no PWM)
|
|
|
- CCS_CP_STATE_F, //F (-12V, no PWM)
|
|
|
- CCS_CP_STATE_G, //G (>12V)
|
|
|
- CCS_CP_STATE_H //H (<12V)
|
|
|
+ CCS_CP_STATE_UNKNOWN = 0, CCS_CP_STATE_A, //A (12V, no PWM)
|
|
|
+ CCS_CP_STATE_B1, //B1 (9V, no PWM)
|
|
|
+ CCS_CP_STATE_B2, //B2 (9V, with PWM)
|
|
|
+ CCS_CP_STATE_C, //C (6V, with PWM)
|
|
|
+ CCS_CP_STATE_D, //D (3V, with PWM)
|
|
|
+ CCS_CP_STATE_E, //E (0V, no PWM)
|
|
|
+ CCS_CP_STATE_F, //F (-12V, no PWM)
|
|
|
+ CCS_CP_STATE_G, //G (>12V)
|
|
|
+ CCS_CP_STATE_H //H (<12V)
|
|
|
};
|
|
|
|
|
|
//===================================
|
|
@@ -126,7 +145,7 @@ enum CCS_CP_STATE
|
|
|
//===================================
|
|
|
enum SPEAKER_ACTION
|
|
|
{
|
|
|
- SPEAKER_STOP=0,
|
|
|
+ SPEAKER_STOP = 0,
|
|
|
SPEAKER_ALWAYS_ON,
|
|
|
SPEAKER_SHORT,
|
|
|
SPEAKER_LONG,
|
|
@@ -140,7 +159,7 @@ enum SPEAKER_ACTION
|
|
|
//===================================
|
|
|
enum LED_ACTION
|
|
|
{
|
|
|
- LED_ACTION_INIT=0,
|
|
|
+ LED_ACTION_INIT = 0,
|
|
|
LED_ACTION_IDLE,
|
|
|
LED_ACTION_AUTHED,
|
|
|
LED_ACTION_CONNECTED,
|
|
@@ -171,16 +190,17 @@ enum LED_ACTION
|
|
|
//===================================
|
|
|
enum START_METHOD
|
|
|
{
|
|
|
- START_METHOD_FREE=0,
|
|
|
+ START_METHOD_FREE = 0,
|
|
|
START_METHOD_RFID,
|
|
|
START_METHOD_BACKEND,
|
|
|
START_METHOD_BLE,
|
|
|
- START_METHOD_EVCCID
|
|
|
+ START_METHOD_EVCCID,
|
|
|
+ START_METHOD_CMD
|
|
|
};
|
|
|
|
|
|
enum HANDSHAKE_STATE
|
|
|
{
|
|
|
- HANDSHAKE_IDLE=0,
|
|
|
+ HANDSHAKE_IDLE = 0,
|
|
|
HANDSHAKE_DUTY_5,
|
|
|
HANDSHAKE_DUTY_5_CHECK,
|
|
|
HANDSHAKE_CCS,
|
|
@@ -192,36 +212,27 @@ enum HANDSHAKE_STATE
|
|
|
|
|
|
enum EV_READY_STATE
|
|
|
{
|
|
|
- EV_READY_STAT_E=1,
|
|
|
- EV_READY_STAT_C,
|
|
|
- EV_READY_SET_MAX_CURRENT
|
|
|
+ EV_READY_STAT_E = 1, EV_READY_STAT_C, EV_READY_SET_MAX_CURRENT
|
|
|
};
|
|
|
|
|
|
enum CHARGING_MODE
|
|
|
{
|
|
|
- CHARGING_MODE_BS=0,
|
|
|
- CHARGING_MODE_HLC,
|
|
|
- CHARGING_MODE_SOCKETE
|
|
|
+ CHARGING_MODE_BS = 0, CHARGING_MODE_HLC, CHARGING_MODE_SOCKETE
|
|
|
};
|
|
|
|
|
|
enum HLC_MODE
|
|
|
{
|
|
|
- HLC_START_MODE=0,
|
|
|
- HLC_STOP_MODE,
|
|
|
- HLC_RENEGOTIATE_MODE,
|
|
|
- HLC_STANDBY_MODE
|
|
|
+ HLC_START_MODE = 0, HLC_STOP_MODE, HLC_RENEGOTIATE_MODE, HLC_STANDBY_MODE
|
|
|
};
|
|
|
|
|
|
enum EVSE_NOTIFICATION
|
|
|
{
|
|
|
- NOTIFICATION_NONE=0,
|
|
|
- NOTIFICATION_STOP,
|
|
|
- NOTIFICATION_RENEGOTIATION
|
|
|
+ NOTIFICATION_NONE = 0, NOTIFICATION_STOP, NOTIFICATION_RENEGOTIATION
|
|
|
};
|
|
|
|
|
|
enum TIMER_IDX
|
|
|
{
|
|
|
- TMR_IDX_HANDSHAKING=0,
|
|
|
+ TMR_IDX_HANDSHAKING = 0,
|
|
|
TMR_IDX_AUTH,
|
|
|
TMR_IDX_REFRESH_CHARGING_INFO,
|
|
|
TMR_IDX_PROFILE_PREPARE,
|
|
@@ -250,10 +261,7 @@ enum TIMER_IDX
|
|
|
//===================================
|
|
|
enum RFID_AUTHORIZATION_STATUS
|
|
|
{
|
|
|
- DEFAULT_RFID = 0,
|
|
|
- VALIDATED_RFID,
|
|
|
- UNVALIDATED_RFID,
|
|
|
- UNKNOW_RFID
|
|
|
+ DEFAULT_RFID = 0, VALIDATED_RFID, UNVALIDATED_RFID, UNKNOW_RFID
|
|
|
};
|
|
|
|
|
|
#define DEBUG_INFO(format, args...) StoreLogMsg("[%s:%d][%s][Info] "format, (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__), __LINE__, __FUNCTION__, ##args)
|
|
@@ -262,7 +270,6 @@ enum RFID_AUTHORIZATION_STATUS
|
|
|
|
|
|
extern int StoreLogMsg(const char *fmt, ...);
|
|
|
|
|
|
-
|
|
|
//============================================================
|
|
|
// Private shared memory key define
|
|
|
//============================================================
|
|
@@ -272,7 +279,7 @@ typedef struct Verion
|
|
|
{
|
|
|
char Version_FW[32];
|
|
|
char Version_HW[32];
|
|
|
-}Ver;
|
|
|
+} Ver;
|
|
|
|
|
|
typedef struct PRESENTINPUTVOLTAGE
|
|
|
{
|
|
@@ -280,7 +287,7 @@ typedef struct PRESENTINPUTVOLTAGE
|
|
|
double L1N_L12;
|
|
|
double L2N_L23;
|
|
|
double L3N_L31;
|
|
|
-}PresentInputVoltage;
|
|
|
+} PresentInputVoltage;
|
|
|
|
|
|
typedef struct PRESENTOUTPUTVOLTAGE
|
|
|
{
|
|
@@ -288,33 +295,33 @@ typedef struct PRESENTOUTPUTVOLTAGE
|
|
|
double behindRelay_Voltage_C1;
|
|
|
double behindFuse_Voltage_C2;
|
|
|
double behindRelay_Voltage_C2;
|
|
|
-}PresentOutputVoltage;
|
|
|
+} PresentOutputVoltage;
|
|
|
|
|
|
typedef struct FANSPEED
|
|
|
{
|
|
|
unsigned short int speed[4];
|
|
|
-}FanSpeed;
|
|
|
+} FanSpeed;
|
|
|
|
|
|
typedef struct TEMPERATURE
|
|
|
{
|
|
|
unsigned char point[8];
|
|
|
-}Temperature;
|
|
|
+} Temperature;
|
|
|
|
|
|
typedef struct AUXPOWER
|
|
|
{
|
|
|
unsigned char voltage[8];
|
|
|
-}AuxPower;
|
|
|
+} AuxPower;
|
|
|
|
|
|
typedef struct RELAY
|
|
|
{
|
|
|
unsigned char relay_status[2][8];
|
|
|
-}Relay;
|
|
|
+} Relay;
|
|
|
|
|
|
typedef struct GFD
|
|
|
{
|
|
|
unsigned short int adc_value_positive[2];
|
|
|
unsigned short int adc_value_negative[2];
|
|
|
-}Gfd;
|
|
|
+} Gfd;
|
|
|
|
|
|
typedef struct GPIO_IN
|
|
|
{
|
|
@@ -326,33 +333,33 @@ typedef struct GPIO_IN
|
|
|
unsigned char Button[2];
|
|
|
unsigned char Button_Emergency;
|
|
|
unsigned char Button_Mode_Switch;
|
|
|
-}Gpio_in;
|
|
|
+} Gpio_in;
|
|
|
|
|
|
typedef struct GPIO_OUT
|
|
|
{
|
|
|
unsigned char AC_Connector;
|
|
|
unsigned char Button_LED[2];
|
|
|
unsigned char System_LED[4];
|
|
|
-}Gpio_out;
|
|
|
+} Gpio_out;
|
|
|
|
|
|
typedef struct ALARM_LOG
|
|
|
{
|
|
|
unsigned char logArea;
|
|
|
unsigned int alarmIndex;
|
|
|
unsigned char log[8];
|
|
|
-}Alarm_Log;
|
|
|
+} Alarm_Log;
|
|
|
|
|
|
typedef struct BLE_CONFIG_DATA
|
|
|
{
|
|
|
- unsigned char isLogin:1;
|
|
|
- unsigned char isRequestStart:1;
|
|
|
- unsigned char isRequestStop:1;
|
|
|
-}Ble_Config_Data;
|
|
|
+ unsigned char isLogin :1;
|
|
|
+ unsigned char isRequestStart :1;
|
|
|
+ unsigned char isRequestStop :1;
|
|
|
+} Ble_Config_Data;
|
|
|
|
|
|
typedef struct BLE_LONGIN_CENTRAL_ID
|
|
|
{
|
|
|
unsigned char id[32];
|
|
|
-}Ble_Login_Central_Id;
|
|
|
+} Ble_Login_Central_Id;
|
|
|
|
|
|
typedef struct RTC
|
|
|
{
|
|
@@ -362,25 +369,25 @@ typedef struct RTC
|
|
|
unsigned char hour;
|
|
|
unsigned char min;
|
|
|
unsigned char sec;
|
|
|
-}Rtc;
|
|
|
+} Rtc;
|
|
|
|
|
|
typedef struct PRESENTOUTPUTCURRENT
|
|
|
{
|
|
|
double L1N_L12[2];
|
|
|
double L2N_L23[2];
|
|
|
double L3N_L31[2];
|
|
|
-}Presentoutputcurrent;
|
|
|
+} Presentoutputcurrent;
|
|
|
|
|
|
typedef struct SOCKET_E
|
|
|
{
|
|
|
- unsigned char isSocketEMode:1;
|
|
|
- unsigned char isSocketEPinOn:1;
|
|
|
-}Socket_E;
|
|
|
+ unsigned char isSocketEMode :1;
|
|
|
+ unsigned char isSocketEPinOn :1;
|
|
|
+} Socket_E;
|
|
|
|
|
|
typedef struct AC_PRIMARY_MCU
|
|
|
{
|
|
|
unsigned char cp_state;
|
|
|
- unsigned int current_limit;
|
|
|
+ unsigned int current_limit;
|
|
|
float cp_voltage_positive;
|
|
|
float cp_voltage_negtive;
|
|
|
unsigned char locker_state;
|
|
@@ -390,9 +397,9 @@ typedef struct AC_PRIMARY_MCU
|
|
|
unsigned char pp_state;
|
|
|
unsigned char rating_current;
|
|
|
unsigned char rotatory_switch;
|
|
|
- Relay relayState;
|
|
|
+ Relay relayState;
|
|
|
Socket_E socket_e;
|
|
|
-}Ac_Primary_Mcu;
|
|
|
+} Ac_Primary_Mcu;
|
|
|
|
|
|
typedef struct AC_PRIMARY_MCU_ALARM
|
|
|
{
|
|
@@ -401,126 +408,126 @@ typedef struct AC_PRIMARY_MCU_ALARM
|
|
|
unsigned long InputAlarmCode;
|
|
|
struct
|
|
|
{
|
|
|
- unsigned long OVP_L1:1;
|
|
|
- unsigned long UVP_L1:1;
|
|
|
- unsigned long OCP_L1:1;
|
|
|
- unsigned long OTP:1;
|
|
|
- unsigned long gmi_fault:1;
|
|
|
- unsigned long cp_fault:1;
|
|
|
- unsigned long ac_leak:1;
|
|
|
- unsigned long dc_leak:1;
|
|
|
- unsigned long mcu_selftest_fail:1;
|
|
|
- unsigned long handshaking_timeout:1;
|
|
|
- unsigned long emergency_stop:1;
|
|
|
- unsigned long relay_welding:1;
|
|
|
- unsigned long leak_module_fail:1;
|
|
|
- unsigned long shutter_fault:1;
|
|
|
- unsigned long locker_fault:1;
|
|
|
- unsigned long power_drop:1;
|
|
|
- unsigned long rotate_switch_fault:1;
|
|
|
- unsigned long short_circuit_L1:1;
|
|
|
- unsigned long relay_drive_fault:1;
|
|
|
- unsigned long comm_timeout:1;
|
|
|
- unsigned long OVP_L2:1;
|
|
|
- unsigned long UVP_L2:1;
|
|
|
- unsigned long OCP_L2:1;
|
|
|
- unsigned long OVP_L3:1;
|
|
|
- unsigned long UVP_L3:1;
|
|
|
- unsigned long OCP_L3:1;
|
|
|
- unsigned long short_circuit_L2:1;
|
|
|
- unsigned long short_circuit_L3:1;
|
|
|
- unsigned long meter_comm_timeout:1;
|
|
|
- unsigned long meter_ic_comm_timeout:1;
|
|
|
- unsigned long pilot_negative_error:1;
|
|
|
- }bits;
|
|
|
+ unsigned long OVP_L1 :1;
|
|
|
+ unsigned long UVP_L1 :1;
|
|
|
+ unsigned long OCP_L1 :1;
|
|
|
+ unsigned long OTP :1;
|
|
|
+ unsigned long gmi_fault :1;
|
|
|
+ unsigned long cp_fault :1;
|
|
|
+ unsigned long ac_leak :1;
|
|
|
+ unsigned long dc_leak :1;
|
|
|
+ unsigned long mcu_selftest_fail :1;
|
|
|
+ unsigned long handshaking_timeout :1;
|
|
|
+ unsigned long emergency_stop :1;
|
|
|
+ unsigned long relay_welding :1;
|
|
|
+ unsigned long leak_module_fail :1;
|
|
|
+ unsigned long shutter_fault :1;
|
|
|
+ unsigned long locker_fault :1;
|
|
|
+ unsigned long power_drop :1;
|
|
|
+ unsigned long rotate_switch_fault :1;
|
|
|
+ unsigned long short_circuit_L1 :1;
|
|
|
+ unsigned long relay_drive_fault :1;
|
|
|
+ unsigned long comm_timeout :1;
|
|
|
+ unsigned long OVP_L2 :1;
|
|
|
+ unsigned long UVP_L2 :1;
|
|
|
+ unsigned long OCP_L2 :1;
|
|
|
+ unsigned long OVP_L3 :1;
|
|
|
+ unsigned long UVP_L3 :1;
|
|
|
+ unsigned long OCP_L3 :1;
|
|
|
+ unsigned long short_circuit_L2 :1;
|
|
|
+ unsigned long short_circuit_L3 :1;
|
|
|
+ unsigned long meter_comm_timeout :1;
|
|
|
+ unsigned long meter_ic_comm_timeout :1;
|
|
|
+ unsigned long pilot_negative_error :1;
|
|
|
+ } bits;
|
|
|
};
|
|
|
-}Ac_Primary_Mcu_Alarm;
|
|
|
+} Ac_Primary_Mcu_Alarm;
|
|
|
|
|
|
typedef struct AC_PRIMARY_MCU_LED
|
|
|
{
|
|
|
unsigned char mode;
|
|
|
unsigned long alarm_code;
|
|
|
-}Ac_Primary_Mcu_Led;
|
|
|
+} Ac_Primary_Mcu_Led;
|
|
|
|
|
|
typedef struct EVSE_ID
|
|
|
{
|
|
|
unsigned char model_name[14];
|
|
|
unsigned char serial_number[12];
|
|
|
-}Evse_Id;
|
|
|
+} Evse_Id;
|
|
|
|
|
|
typedef struct AC_PRIMARY_MCU_CP_PWM_DUTY
|
|
|
{
|
|
|
unsigned int max_current;
|
|
|
-}Ac_Primary_Mcu_Cp_Pwm_Duty;
|
|
|
+} Ac_Primary_Mcu_Cp_Pwm_Duty;
|
|
|
|
|
|
typedef struct LEGACY_REQUEST
|
|
|
{
|
|
|
- unsigned char isLegacyRequest:1;
|
|
|
- uint8_t isRelayOn:1;
|
|
|
-}Legacy_Request;
|
|
|
+ unsigned char isLegacyRequest :1;
|
|
|
+ uint8_t isRelayOn :1;
|
|
|
+} Legacy_Request;
|
|
|
|
|
|
typedef struct POWER_CONSUMPTION
|
|
|
{
|
|
|
uint64_t power_consumption;
|
|
|
uint64_t power_consumption_at_start;
|
|
|
|
|
|
-}Power_Consumption;
|
|
|
+} Power_Consumption;
|
|
|
|
|
|
typedef struct MCU_OP_FLAG
|
|
|
{
|
|
|
- unsigned char isSetModePass:1;
|
|
|
- unsigned char isSetSerialNumberPass:1;
|
|
|
- unsigned char isSetModelNamePass:1;
|
|
|
- unsigned char isReadFwVerPass:1;
|
|
|
- unsigned char isMcuUpgradeReq:1;
|
|
|
- unsigned char isSetCpPwmDuty:1;
|
|
|
- unsigned char isReadMeterIcCorrectionStatus:1;
|
|
|
-}Mcu_Op_Flag;
|
|
|
+ unsigned char isSetModePass :1;
|
|
|
+ unsigned char isSetSerialNumberPass :1;
|
|
|
+ unsigned char isSetModelNamePass :1;
|
|
|
+ unsigned char isReadFwVerPass :1;
|
|
|
+ unsigned char isMcuUpgradeReq :1;
|
|
|
+ unsigned char isSetCpPwmDuty :1;
|
|
|
+ unsigned char isReadMeterIcCorrectionStatus :1;
|
|
|
+} Mcu_Op_Flag;
|
|
|
|
|
|
typedef struct SYSTEM_ALARM_CODE
|
|
|
{
|
|
|
unsigned long SystemAlarmCode;
|
|
|
|
|
|
-}System_Alarm_Code;
|
|
|
+} System_Alarm_Code;
|
|
|
|
|
|
typedef struct OTHER_ALARM_CODE
|
|
|
{
|
|
|
- unsigned long isHandshakingTimeOut:1;
|
|
|
- unsigned long isDcLeakage:1;
|
|
|
- unsigned long isACLeakage:1;
|
|
|
-}Other_Alarm_Code;
|
|
|
+ unsigned long isHandshakingTimeOut :1;
|
|
|
+ unsigned long isDcLeakage :1;
|
|
|
+ unsigned long isACLeakage :1;
|
|
|
+} Other_Alarm_Code;
|
|
|
|
|
|
typedef struct PILOT_VOLTAGE
|
|
|
{
|
|
|
float PilotVoltagePositive;
|
|
|
float PilotVoltageNegative;
|
|
|
|
|
|
-}Pilot_Voltage;
|
|
|
+} Pilot_Voltage;
|
|
|
|
|
|
typedef struct FW_UPGRADE_INFO
|
|
|
{
|
|
|
int fwType;
|
|
|
char modelName[17];
|
|
|
char location[384];
|
|
|
-}Fw_Upgrade_Info;
|
|
|
+} Fw_Upgrade_Info;
|
|
|
|
|
|
typedef struct GUN_PLUGIN_TIMES
|
|
|
{
|
|
|
uint32_t GunPluginTimes;
|
|
|
|
|
|
-}Gun_Plugin_Times;
|
|
|
+} Gun_Plugin_Times;
|
|
|
|
|
|
typedef struct MCU_RESET_REQUEST
|
|
|
{
|
|
|
- unsigned char isMcuResetRequest:1;
|
|
|
-}Mcu_Reset_Request;
|
|
|
+ unsigned char isMcuResetRequest :1;
|
|
|
+} Mcu_Reset_Request;
|
|
|
|
|
|
typedef struct TIMEOUT_SPEC
|
|
|
{
|
|
|
int Setting_Timeout_Spec;
|
|
|
int Present_Timeout_Spec;
|
|
|
int Handshake_Timeout;
|
|
|
-}Timeout_Spec;
|
|
|
+} Timeout_Spec;
|
|
|
|
|
|
typedef struct SET_BREATHE_LED_TIMING
|
|
|
{
|
|
@@ -530,7 +537,7 @@ typedef struct SET_BREATHE_LED_TIMING
|
|
|
uint16_t set_Led_Action_Authed_Fade_Out;
|
|
|
uint16_t Set_Led_Action_Chaging_Fade_In;
|
|
|
uint16_t set_Led_Action_Chaging_Fade_Out;
|
|
|
-}Set_Breathe_Led_Timing;
|
|
|
+} Set_Breathe_Led_Timing;
|
|
|
|
|
|
typedef struct SET_LED_BRIGHTNESS
|
|
|
{
|
|
@@ -546,247 +553,251 @@ typedef struct SET_LED_BRIGHTNESS
|
|
|
uint8_t sector_10; // 18~19 PM and 19~20 PM
|
|
|
uint8_t sector_11; // 20~21 PM and 21~22 PM
|
|
|
uint8_t sector_12; // 22~23 PM and 23~24 PM
|
|
|
-}Set_Led_Brightness;
|
|
|
+} Set_Led_Brightness;
|
|
|
|
|
|
typedef struct SET_AUX_POWER_SWITCH
|
|
|
{
|
|
|
uint8_t power_type; // 0xff: All 0x01: Meter
|
|
|
uint8_t power_switch; // 0: OFF 1: ON
|
|
|
-}Set_Aux_Power_Switch;
|
|
|
+} Set_Aux_Power_Switch;
|
|
|
|
|
|
typedef union
|
|
|
{
|
|
|
unsigned int value;
|
|
|
struct
|
|
|
{
|
|
|
- unsigned int isCalibratedVaGain:1; // Voltage phase a gain is calibrated, 0: default 1: Calibrated
|
|
|
- unsigned int isCalibratedVbGain:1; // Voltage phase b gain is calibrated, 0: default 1: Calibrated
|
|
|
- unsigned int isCalibratedVcGain:1; // Voltage phase c gain is calibrated, 0: default 1: Calibrated
|
|
|
- unsigned int isCalibratedVaOffset:1; // Voltage phase a offset is calibrated, 0: default 1: Calibrated
|
|
|
- unsigned int isCalibratedVbOffset:1; // Voltage phase b offset is calibrated, 0: default 1: Calibrated
|
|
|
- unsigned int isCalibratedVcOffset:1; // Voltage phase c offset is calibrated, 0: default 1: Calibrated
|
|
|
- unsigned int isCalibratedCaGain:1; // Current phase a gain is calibrated, 0: default 1: Calibrated
|
|
|
- unsigned int isCalibratedCbGain:1; // Current phase b gain is calibrated, 0: default 1: Calibrated
|
|
|
- unsigned int isCalibratedCcGain:1; // Current phase c gain is calibrated, 0: default 1: Calibrated
|
|
|
- unsigned int isCalibratedCaOffset:1; // Current phase a offset is calibrated, 0: default 1: Calibrated
|
|
|
- unsigned int isCalibratedCbOffset:1; // Current phase b offset is calibrated, 0: default 1: Calibrated
|
|
|
- unsigned int isCalibratedCcOffset:1; // Current phase c offset is calibrated, 0: default 1: Calibrated
|
|
|
- unsigned int isCalibratedPa:1; // Phase angle a is calibrated, 0: default 1: Calibrated
|
|
|
- unsigned int isCalibratedPb:1; // Phase angle b gain is calibrated, 0: default 1: Calibrated
|
|
|
- unsigned int isCalibratedPc:1; // Phase angle c gain is calibrated, 0: default 1: Calibrated
|
|
|
+ unsigned int isCalibratedVaGain :1; // Voltage phase a gain is calibrated, 0: default 1: Calibrated
|
|
|
+ unsigned int isCalibratedVbGain :1; // Voltage phase b gain is calibrated, 0: default 1: Calibrated
|
|
|
+ unsigned int isCalibratedVcGain :1; // Voltage phase c gain is calibrated, 0: default 1: Calibrated
|
|
|
+ unsigned int isCalibratedVaOffset :1; // Voltage phase a offset is calibrated, 0: default 1: Calibrated
|
|
|
+ unsigned int isCalibratedVbOffset :1; // Voltage phase b offset is calibrated, 0: default 1: Calibrated
|
|
|
+ unsigned int isCalibratedVcOffset :1; // Voltage phase c offset is calibrated, 0: default 1: Calibrated
|
|
|
+ unsigned int isCalibratedCaGain :1; // Current phase a gain is calibrated, 0: default 1: Calibrated
|
|
|
+ unsigned int isCalibratedCbGain :1; // Current phase b gain is calibrated, 0: default 1: Calibrated
|
|
|
+ unsigned int isCalibratedCcGain :1; // Current phase c gain is calibrated, 0: default 1: Calibrated
|
|
|
+ unsigned int isCalibratedCaOffset :1; // Current phase a offset is calibrated, 0: default 1: Calibrated
|
|
|
+ unsigned int isCalibratedCbOffset :1; // Current phase b offset is calibrated, 0: default 1: Calibrated
|
|
|
+ unsigned int isCalibratedCcOffset :1; // Current phase c offset is calibrated, 0: default 1: Calibrated
|
|
|
+ unsigned int isCalibratedPa :1; // Phase angle a is calibrated, 0: default 1: Calibrated
|
|
|
+ unsigned int isCalibratedPb :1; // Phase angle b gain is calibrated, 0: default 1: Calibrated
|
|
|
+ unsigned int isCalibratedPc :1; // Phase angle c gain is calibrated, 0: default 1: Calibrated
|
|
|
unsigned int :17;
|
|
|
- }bits;
|
|
|
-}MeterIcCorrection;
|
|
|
+ } bits;
|
|
|
+} MeterIcCorrection;
|
|
|
|
|
|
typedef struct CCS_INFO
|
|
|
{
|
|
|
- uint8_t BatteryChargeType; /*0x00: AC charging, 0x01: DC charging*/
|
|
|
- uint8_t PresentMsgFlowStatus;
|
|
|
- /* ISO15118_2018
|
|
|
- 0: Idle(wait B2 state),
|
|
|
- 1: CM_SLAC_PARM.REQ,
|
|
|
- 2: CM_SLAC_PARM.CNF,
|
|
|
- 3: CM_START_ATTEN_CHAR.IND
|
|
|
- 4: CM_MNBC_SOUND.IND,
|
|
|
- 5: CM_ATTEN_CHAR.IND,
|
|
|
- 6: CM_ATTEN_CHAR.RSP,
|
|
|
- 7: CM_VALIDATE.REQ
|
|
|
- 8: CM_VALIDATE.CNF,
|
|
|
- 9: CM_SLAC_MATCH.REQ,
|
|
|
- 10: CM_SLAC_MATCH.CNF,
|
|
|
- 11: CM_AMP_MAP.REQ
|
|
|
- 12: CM_AMP_MAP.CNF,
|
|
|
- 13: SLACC/SDP/TCP connection,
|
|
|
- 16: SupportedAppProtocolRequest,
|
|
|
- 17: SupportedAppProtocolResponse,
|
|
|
- 18: SessionSetupRequest
|
|
|
- 19: SessionSetupResponse,
|
|
|
- 20: ServiceDiscoveryRequest,
|
|
|
- 21: ServiceDiscoveryResponse
|
|
|
- 22: ServiceDetailRequest,
|
|
|
- 23: ServiceDetailResponse
|
|
|
- 24:ServiceAndPaymentSelectionRequest/ServiceSelectionRequest,
|
|
|
- 25: ServiceAndPaymentSelectionResponse/ServiceSelectionResponse
|
|
|
- 26: PaymentDetailsRequest/IdentificationDetailsRequest;,
|
|
|
- 27: PaymentDetailsResponse/IdentificationDetailsResponse,
|
|
|
- 28: AuthorizationRequest,
|
|
|
- 29: AuthorizationResponse,
|
|
|
- 30: CertificateUpdateRequest,
|
|
|
- 31: CertificateUpdateResponse,
|
|
|
- 32:CertificateInstallationRequest,
|
|
|
- 33: CertificateInstallationResponse
|
|
|
- 34: ChargeParameterDiscoveryRequest,
|
|
|
- 35: ChargeParameterDiscoveryResponse
|
|
|
- 36: CableCheckRequest,
|
|
|
- 37: CableCheckResponse,
|
|
|
- 38: PreChargeRequest,
|
|
|
- 39: PreChargeResponse
|
|
|
- 40: PowerDeliveryRequest start,
|
|
|
- 41: PowerDeliveryResponse start,
|
|
|
- 42: ChargingStatusRequest,
|
|
|
- 43: ChargingStatusResponse
|
|
|
- 44:CurrentDemandRequest,
|
|
|
- 45:CurrentDemandResponse,
|
|
|
- 46:MeteringReceiptRequest,
|
|
|
- 47: MeteringReceiptResponse
|
|
|
- 48: PowerDeliveryRequest end,
|
|
|
- 49: PowerDeliveryRequest end,
|
|
|
- 50: WeldingDetectionRequest,
|
|
|
- 51: WeldingDetectionResponse,
|
|
|
- 52: SessionStopRequest,
|
|
|
- 53: SessionStopResponse
|
|
|
- 253: Performance Timeout,
|
|
|
- 254: Sequence Timeout,
|
|
|
- 255: Fault
|
|
|
- */
|
|
|
-
|
|
|
- float ConnectorTemperature1; /*unit: 1°C*/
|
|
|
- float ConnectorTemperature2; /*unit: 1°C*/
|
|
|
- uint16_t ChargingRemainTime; /*0x0000: 0 sec ~ 0xFFFF: 65535 sec, unit: 1 second*/
|
|
|
- float TotalBatteryCapacity; /*unit: Wh*/
|
|
|
- float BatteryMaximumVoltage; /*unit: 1 volt*/
|
|
|
- float BatteryMaximumCurrent; /*unit: 1 amp*/
|
|
|
- uint8_t EVCCID[8];
|
|
|
- uint8_t EVSEID[40];
|
|
|
- uint8_t CCSLibRev[32];
|
|
|
- uint8_t EVSEModelName[32];
|
|
|
- uint32_t CSUAlarmStatusCode;
|
|
|
- uint16_t CCSAlarmStatusCode;
|
|
|
- uint8_t PaymentOption; /* 0x00 EIM, 0x01 Pnc */
|
|
|
- float EVSEMaxCurrent; /*unit: 1 amp*/
|
|
|
- float EVSEMinCurrent; /*unit: 1 amp*/
|
|
|
- float GridVoltage[3]; /*unit: 1 volt*/
|
|
|
- uint8_t MeterID[32]; /*unit: 1 amp*/
|
|
|
- float MeterReadingValue; /*unit: 1Wh*/
|
|
|
- uint8_t EVOperation; /*0:Charge, 1:Discharge*/
|
|
|
- uint8_t EVChargeProgress; /*0: Stop
|
|
|
- 1: Start
|
|
|
- 2: Renegotiate
|
|
|
- 3: Standby */
|
|
|
- uint8_t CpSetPWMDuty; /*unit: 1%
|
|
|
- 0: 0%
|
|
|
- 5: 5%
|
|
|
- 100: 100%*/
|
|
|
- uint8_t CpSetStateE; /*0:disable, 1:enable*/
|
|
|
- uint8_t CpPresentPWMDuty; /*unit:1%*/
|
|
|
- uint8_t CpPresentState; /*1: A (12V, no PWM)
|
|
|
- 2: B1 (9V, no PWM)
|
|
|
- 3: B2 (9V, with PWM)
|
|
|
- 4: C (6V, with PWM)
|
|
|
- 5: D (3V, with PWM)
|
|
|
- 6: E (0V, no PWM)
|
|
|
- 7: F (-12V, no PWM)
|
|
|
- 8: G (>12V)
|
|
|
- 9: H (<12V)*/
|
|
|
- float CpPositiveVoltage; /*uint: 1V*/
|
|
|
- float CpNegativeVoltage; /*uint: 1V*/
|
|
|
- uint32_t CcsHeartBeat; /*unit: 1*/
|
|
|
- float EVSEPresentCurrent[3]; //unit: 1A
|
|
|
- float AvailableChargingPower; //1KW
|
|
|
- uint8_t EVSENotification; /*0: None
|
|
|
- 1: StopCharging
|
|
|
- 2: ReNegotiation*/
|
|
|
- uint16_t ChargingPermission:1; /*0x00: Not ready yet, stay in idle mode or go into terminating process.
|
|
|
- 0x01: start charging process*/
|
|
|
- uint16_t ConnectorLockerStatus:1; /*0x00: released
|
|
|
- 0x01: locked*/
|
|
|
-
|
|
|
- uint16_t RcdStatus:1; /* 0x00 no error
|
|
|
- 0x01 an error */
|
|
|
- uint16_t OutputRelayStatus:1; /*0: OFF
|
|
|
- 1: ON*/
|
|
|
- uint16_t TempFlag4:1;
|
|
|
- uint16_t TempFlag5:1;
|
|
|
- uint16_t TempFlag6:1;
|
|
|
- uint16_t TempFlag7:1;
|
|
|
- uint16_t TempFlag8:1;
|
|
|
- uint16_t TempFlag9:1;
|
|
|
- uint16_t TempFlag10:1;
|
|
|
- uint16_t TempFlag11:1;
|
|
|
- uint16_t TempFlag12:1;
|
|
|
- uint16_t TempFlag13:1;
|
|
|
- uint16_t TempFlag14:1;
|
|
|
- uint16_t TempFlag15:1;
|
|
|
-}Ac_Ccs_Info;
|
|
|
+ uint8_t BatteryChargeType; /*0x00: AC charging, 0x01: DC charging*/
|
|
|
+ uint8_t PresentMsgFlowStatus;
|
|
|
+ /* ISO15118_2018
|
|
|
+ 0: Idle(wait B2 state),
|
|
|
+ 1: CM_SLAC_PARM.REQ,
|
|
|
+ 2: CM_SLAC_PARM.CNF,
|
|
|
+ 3: CM_START_ATTEN_CHAR.IND
|
|
|
+ 4: CM_MNBC_SOUND.IND,
|
|
|
+ 5: CM_ATTEN_CHAR.IND,
|
|
|
+ 6: CM_ATTEN_CHAR.RSP,
|
|
|
+ 7: CM_VALIDATE.REQ
|
|
|
+ 8: CM_VALIDATE.CNF,
|
|
|
+ 9: CM_SLAC_MATCH.REQ,
|
|
|
+ 10: CM_SLAC_MATCH.CNF,
|
|
|
+ 11: CM_AMP_MAP.REQ
|
|
|
+ 12: CM_AMP_MAP.CNF,
|
|
|
+ 13: SLACC/SDP/TCP connection,
|
|
|
+ 16: SupportedAppProtocolRequest,
|
|
|
+ 17: SupportedAppProtocolResponse,
|
|
|
+ 18: SessionSetupRequest
|
|
|
+ 19: SessionSetupResponse,
|
|
|
+ 20: ServiceDiscoveryRequest,
|
|
|
+ 21: ServiceDiscoveryResponse
|
|
|
+ 22: ServiceDetailRequest,
|
|
|
+ 23: ServiceDetailResponse
|
|
|
+ 24:ServiceAndPaymentSelectionRequest/ServiceSelectionRequest,
|
|
|
+ 25: ServiceAndPaymentSelectionResponse/ServiceSelectionResponse
|
|
|
+ 26: PaymentDetailsRequest/IdentificationDetailsRequest;,
|
|
|
+ 27: PaymentDetailsResponse/IdentificationDetailsResponse,
|
|
|
+ 28: AuthorizationRequest,
|
|
|
+ 29: AuthorizationResponse,
|
|
|
+ 30: CertificateUpdateRequest,
|
|
|
+ 31: CertificateUpdateResponse,
|
|
|
+ 32:CertificateInstallationRequest,
|
|
|
+ 33: CertificateInstallationResponse
|
|
|
+ 34: ChargeParameterDiscoveryRequest,
|
|
|
+ 35: ChargeParameterDiscoveryResponse
|
|
|
+ 36: CableCheckRequest,
|
|
|
+ 37: CableCheckResponse,
|
|
|
+ 38: PreChargeRequest,
|
|
|
+ 39: PreChargeResponse
|
|
|
+ 40: PowerDeliveryRequest start,
|
|
|
+ 41: PowerDeliveryResponse start,
|
|
|
+ 42: ChargingStatusRequest,
|
|
|
+ 43: ChargingStatusResponse
|
|
|
+ 44:CurrentDemandRequest,
|
|
|
+ 45:CurrentDemandResponse,
|
|
|
+ 46:MeteringReceiptRequest,
|
|
|
+ 47: MeteringReceiptResponse
|
|
|
+ 48: PowerDeliveryRequest end,
|
|
|
+ 49: PowerDeliveryRequest end,
|
|
|
+ 50: WeldingDetectionRequest,
|
|
|
+ 51: WeldingDetectionResponse,
|
|
|
+ 52: SessionStopRequest,
|
|
|
+ 53: SessionStopResponse
|
|
|
+ 253: Performance Timeout,
|
|
|
+ 254: Sequence Timeout,
|
|
|
+ 255: Fault
|
|
|
+ */
|
|
|
+
|
|
|
+ float ConnectorTemperature1; /*unit: 1°C*/
|
|
|
+ float ConnectorTemperature2; /*unit: 1°C*/
|
|
|
+ uint16_t ChargingRemainTime; /*0x0000: 0 sec ~ 0xFFFF: 65535 sec, unit: 1 second*/
|
|
|
+ float TotalBatteryCapacity; /*unit: Wh*/
|
|
|
+ float BatteryMaximumVoltage; /*unit: 1 volt*/
|
|
|
+ float BatteryMaximumCurrent; /*unit: 1 amp*/
|
|
|
+ uint8_t EVCCID[8];
|
|
|
+ uint8_t EVSEID[40];
|
|
|
+ uint8_t CCSLibRev[32];
|
|
|
+ uint8_t EVSEModelName[32];
|
|
|
+ uint32_t CSUAlarmStatusCode;
|
|
|
+ uint16_t CCSAlarmStatusCode;
|
|
|
+ uint8_t PaymentOption; /* 0x00 EIM, 0x01 Pnc */
|
|
|
+ float EVSEMaxCurrent; /*unit: 1 amp*/
|
|
|
+ float EVSEMinCurrent; /*unit: 1 amp*/
|
|
|
+ float GridVoltage[3]; /*unit: 1 volt*/
|
|
|
+ uint8_t MeterID[32]; /*unit: 1 amp*/
|
|
|
+ float MeterReadingValue; /*unit: 1Wh*/
|
|
|
+ uint8_t EVOperation; /*0:Charge, 1:Discharge*/
|
|
|
+ uint8_t EVChargeProgress; /*0: Stop
|
|
|
+ 1: Start
|
|
|
+ 2: Renegotiate
|
|
|
+ 3: Standby */
|
|
|
+ uint8_t CpSetPWMDuty; /*unit: 1%
|
|
|
+ 0: 0%
|
|
|
+ 5: 5%
|
|
|
+ 100: 100%*/
|
|
|
+ uint8_t CpSetStateE; /*0:disable, 1:enable*/
|
|
|
+ uint8_t CpPresentPWMDuty; /*unit:1%*/
|
|
|
+ uint8_t CpPresentState; /*1: A (12V, no PWM)
|
|
|
+ 2: B1 (9V, no PWM)
|
|
|
+ 3: B2 (9V, with PWM)
|
|
|
+ 4: C (6V, with PWM)
|
|
|
+ 5: D (3V, with PWM)
|
|
|
+ 6: E (0V, no PWM)
|
|
|
+ 7: F (-12V, no PWM)
|
|
|
+ 8: G (>12V)
|
|
|
+ 9: H (<12V)*/
|
|
|
+ float CpPositiveVoltage; /*uint: 1V*/
|
|
|
+ float CpNegativeVoltage; /*uint: 1V*/
|
|
|
+ uint32_t CcsHeartBeat; /*unit: 1*/
|
|
|
+ float EVSEPresentCurrent[3]; //unit: 1A
|
|
|
+ float AvailableChargingPower; //1KW
|
|
|
+ uint8_t EVSENotification; /*0: None
|
|
|
+ 1: StopCharging
|
|
|
+ 2: ReNegotiation*/
|
|
|
+ uint16_t ChargingPermission :1; /*0x00: Not ready yet, stay in idle mode or go into terminating process.
|
|
|
+ 0x01: start charging process*/
|
|
|
+ uint16_t ConnectorLockerStatus :1; /*0x00: released
|
|
|
+ 0x01: locked*/
|
|
|
+
|
|
|
+ uint16_t RcdStatus :1; /* 0x00 no error
|
|
|
+ 0x01 an error */
|
|
|
+ uint16_t OutputRelayStatus :1; /*0: OFF
|
|
|
+ 1: ON*/
|
|
|
+ uint16_t TempFlag4 :1;
|
|
|
+ uint16_t TempFlag5 :1;
|
|
|
+ uint16_t TempFlag6 :1;
|
|
|
+ uint16_t TempFlag7 :1;
|
|
|
+ uint16_t TempFlag8 :1;
|
|
|
+ uint16_t TempFlag9 :1;
|
|
|
+ uint16_t TempFlag10 :1;
|
|
|
+ uint16_t TempFlag11 :1;
|
|
|
+ uint16_t TempFlag12 :1;
|
|
|
+ uint16_t TempFlag13 :1;
|
|
|
+ uint16_t TempFlag14 :1;
|
|
|
+ uint16_t TempFlag15 :1;
|
|
|
+} Ac_Ccs_Info;
|
|
|
|
|
|
typedef struct GUN_INFO
|
|
|
{
|
|
|
- Ver ver;
|
|
|
- PresentInputVoltage inputVoltage;
|
|
|
- Presentoutputcurrent outputCurrent;
|
|
|
- Temperature temperature;
|
|
|
- Ble_Config_Data bleConfigData;
|
|
|
- Ble_Login_Central_Id bleLoginCentralId;
|
|
|
- Rtc rtc;
|
|
|
- Ac_Primary_Mcu primaryMcuState;
|
|
|
- Ac_Primary_Mcu_Alarm primaryMcuAlarm;
|
|
|
- Ac_Primary_Mcu_Led primaryMcuLed;
|
|
|
- Mcu_Op_Flag mcuFlag;
|
|
|
- Power_Consumption powerConsumptionTotal;
|
|
|
- Power_Consumption powerConsumption[3];
|
|
|
- Legacy_Request legacyRequest;
|
|
|
- System_Alarm_Code systemAlarmCode;
|
|
|
- Ac_Primary_Mcu_Cp_Pwm_Duty primaryMcuCp_Pwn_Duty;
|
|
|
- Other_Alarm_Code otherAlarmCode;
|
|
|
- Pilot_Voltage PilotVoltage;
|
|
|
- Gun_Plugin_Times gunPluginTimes;
|
|
|
- Mcu_Reset_Request mcuResetRequest;
|
|
|
- Set_Breathe_Led_Timing setBreatheLedTiming;
|
|
|
- Set_Led_Brightness setLedBrightness;
|
|
|
- Set_Aux_Power_Switch setAuxPowerSwitch;
|
|
|
- Gpio_in GPIO_Input;
|
|
|
- Ac_Ccs_Info acCcsInfo;
|
|
|
- float presentChargedEnergyPeriod[24]; // Session present charged energy at each period, resolution: 0.01 KWH
|
|
|
- uint8_t ccsHandshakeState;
|
|
|
- uint8_t PreviousEVChargeProgress;
|
|
|
- uint8_t chargingMode;
|
|
|
- uint16_t targetCurrent;
|
|
|
- uint8_t evReadyState;
|
|
|
- uint8_t resultAuthorization;
|
|
|
- MeterIcCorrection meterIcCorrectionStatus;
|
|
|
- uint8_t isGunUnpluggedBefore;
|
|
|
-
|
|
|
- uint32_t isAuthPassEnd:1;
|
|
|
- uint32_t rfidReq:1;
|
|
|
- uint32_t isGunPlugged:1;
|
|
|
- uint32_t isSetBreatheLedTiming:1;
|
|
|
- uint32_t isSetLedBrightness:1;
|
|
|
- uint32_t isUnlockerConnetor:1;
|
|
|
- uint32_t isOperactive:1;
|
|
|
- uint32_t isCCSWaitChangeDuty:1;
|
|
|
- uint32_t isCCSStartTransation:1;
|
|
|
- uint32_t isEvReady2StateE:1;
|
|
|
- uint32_t isDoEvReadyOnce:1;
|
|
|
- uint32_t isChargerStopByCondition:1;
|
|
|
- uint32_t isMeterOn:1;
|
|
|
- uint32_t isSleepOn:1;
|
|
|
- uint32_t isCheckPowerConsumption:1;
|
|
|
- uint32_t isHandshakeTimerRefresh:1;
|
|
|
- uint32_t isEmergencyStopReport:1;
|
|
|
- uint32_t isGetEvCCID:1;
|
|
|
- uint32_t isGetEvCCIDTimeout:1;
|
|
|
- uint32_t isRemoteStartWait:1;
|
|
|
- uint32_t isEvCCIDAuthorizeFail:1;
|
|
|
-}Gun_Info;
|
|
|
+ Ver ver;
|
|
|
+ PresentInputVoltage inputVoltage;
|
|
|
+ Presentoutputcurrent outputCurrent;
|
|
|
+ Temperature temperature;
|
|
|
+ Ble_Config_Data bleConfigData;
|
|
|
+ Ble_Login_Central_Id bleLoginCentralId;
|
|
|
+ Rtc rtc;
|
|
|
+ Ac_Primary_Mcu primaryMcuState;
|
|
|
+ Ac_Primary_Mcu_Alarm primaryMcuAlarm;
|
|
|
+ Ac_Primary_Mcu_Led primaryMcuLed;
|
|
|
+ Mcu_Op_Flag mcuFlag;
|
|
|
+ Power_Consumption powerConsumptionTotal;
|
|
|
+ Power_Consumption powerConsumption[3];
|
|
|
+ Legacy_Request legacyRequest;
|
|
|
+ System_Alarm_Code systemAlarmCode;
|
|
|
+ Ac_Primary_Mcu_Cp_Pwm_Duty primaryMcuCp_Pwn_Duty;
|
|
|
+ Other_Alarm_Code otherAlarmCode;
|
|
|
+ Pilot_Voltage PilotVoltage;
|
|
|
+ Gun_Plugin_Times gunPluginTimes;
|
|
|
+ Mcu_Reset_Request mcuResetRequest;
|
|
|
+ Set_Breathe_Led_Timing setBreatheLedTiming;
|
|
|
+ Set_Led_Brightness setLedBrightness;
|
|
|
+ Set_Aux_Power_Switch setAuxPowerSwitch;
|
|
|
+ Gpio_in GPIO_Input;
|
|
|
+ Ac_Ccs_Info acCcsInfo;
|
|
|
+ float presentChargedEnergyPeriod[24]; // Session present charged energy at each period, resolution: 0.01 KWH
|
|
|
+ uint8_t ccsHandshakeState;
|
|
|
+ uint8_t PreviousEVChargeProgress;
|
|
|
+ uint8_t chargingMode;
|
|
|
+ uint16_t targetCurrent;
|
|
|
+ uint8_t evReadyState;
|
|
|
+ uint8_t resultAuthorization;
|
|
|
+ MeterIcCorrection meterIcCorrectionStatus;
|
|
|
+ uint8_t isGunUnpluggedBefore;
|
|
|
+ uint8_t AuthAcceptUserId[32];
|
|
|
+ float ChargingProfilePower;
|
|
|
+ float ChargingProfileCurrent;
|
|
|
+
|
|
|
+ uint32_t isAuthPassEnd :1;
|
|
|
+ uint32_t rfidReq :1;
|
|
|
+ uint32_t isGunPlugged :1;
|
|
|
+ uint32_t isSetBreatheLedTiming :1;
|
|
|
+ uint32_t isSetLedBrightness :1;
|
|
|
+ uint32_t isUnlockerConnetor :1;
|
|
|
+ uint32_t isOperactive :1;
|
|
|
+ uint32_t isCCSWaitChangeDuty :1;
|
|
|
+ uint32_t isCCSStartTransation :1;
|
|
|
+ uint32_t isEvReady2StateE :1;
|
|
|
+ uint32_t isDoEvReadyOnce :1;
|
|
|
+ uint32_t isChargerStopByCondition :1;
|
|
|
+ uint32_t isMeterOn :1;
|
|
|
+ uint32_t isSleepOn :1;
|
|
|
+ uint32_t isCheckPowerConsumption :1;
|
|
|
+ uint32_t isHandshakeTimerRefresh :1;
|
|
|
+ uint32_t isEmergencyStopReport :1;
|
|
|
+ uint32_t isGetEvCCID :1;
|
|
|
+ uint32_t isGetEvCCIDTimeout :1;
|
|
|
+ uint32_t isRemoteStartWait :1;
|
|
|
+ uint32_t isEvCCIDAuthorizeFail :1;
|
|
|
+ uint32_t isCmdToPrepareMode :1; //lwtest
|
|
|
+} Gun_Info;
|
|
|
|
|
|
struct Charger
|
|
|
{
|
|
|
- Ver ver;
|
|
|
- Evse_Id evseId;
|
|
|
- Gun_Info gun_info[3];
|
|
|
- Fw_Upgrade_Info fwUpgradeInfo;
|
|
|
- Timeout_Spec timeoutSpec;
|
|
|
-
|
|
|
- uint8_t gun_selectd;
|
|
|
- uint8_t speaker_type;
|
|
|
- uint16_t isSpeakerOn:1;
|
|
|
- uint16_t isUpdateSuccess:1;
|
|
|
- uint16_t isCcsEnable:1;
|
|
|
- uint16_t isLcdOn:1;
|
|
|
- uint16_t isAuthrizing:1;
|
|
|
- uint16_t isGetAuthResult:1;
|
|
|
- uint16_t isUpgradeLcmReq:1;
|
|
|
- uint16_t isUpgradeLcmSuccess:1;
|
|
|
+ Ver ver;
|
|
|
+ Evse_Id evseId;
|
|
|
+ Gun_Info gun_info[3];
|
|
|
+ Fw_Upgrade_Info fwUpgradeInfo;
|
|
|
+ Timeout_Spec timeoutSpec;
|
|
|
+
|
|
|
+ uint8_t gun_selectd;
|
|
|
+ uint8_t speaker_type;
|
|
|
+ uint16_t isSpeakerOn :1;
|
|
|
+ uint16_t isUpdateSuccess :1;
|
|
|
+ uint16_t isCcsEnable :1;
|
|
|
+ uint16_t isLcdOn :1;
|
|
|
+ uint16_t isAuthrizing :1;
|
|
|
+ uint16_t isGetAuthResult :1;
|
|
|
+ uint16_t isUpgradeLcmReq :1;
|
|
|
+ uint16_t isUpgradeLcmSuccess :1;
|
|
|
};
|
|
|
|
|
|
#endif /* CONFIG_MAIN_H_ */
|