123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188 |
- #ifndef MODULE_EVCOMM_H_
- #define MODULE_EVCOMM_H_
- #define SOCKET_SERVER_IP "192.168.0.10"
- #define PACKET_HEADER_LENGTH 4
- #define MAXIMUM_PAYLOAD_LENGTH 249
- #define TCP_LISTEN_PORT 36000
- #define SOCKET_RECEIVE_INTERVAL 10
- #define DISPENSER_SOCKET_TIMEOUT 10000
- #define DISPENSER_MODEL_NAME_RESEND 3000
- #define DISPENSER_CONNECTOR_RESEND 3000
- #define CABINET_STATUS_REQUEST_RESEND 1000
- #define CHARGING_CAPABILITY_RESEND 1000
- #define CONNECTION_LIMIT 5
- #define MAXIMUM_CONNECT_QUANTITY 2
- #define CCS_MAX_PHYSICAL_VOLTAGE 9500
- #define CCS_NATURAL_MAX_CURRENT 2000
- #define CCS_LIQUID_MAX_CURRENT 5000
- #define CHA_MAX_PHYSICAL_VOLTAGE 5000
- #define CHA_NATURAL_MAX_CURRENT 2000
- #define GBT_MAX_PHYSICAL_VOLTAGE 7500
- #define GBT_NATURAL_MAX_CURRENT 2500
- struct Message
- {
- int size;
- unsigned char buffer[2048];
- };
- enum HEADER_OP
- {
- _Header_Read = 0x01,
- _Header_Write = 0x02,
- _Header_Response = 0x03,
- };
- enum PAYLOAD_REGISTER
- {
- _Reg_Dispenser_Model_Name = 0x01,
- _Reg_Connector_ID = 0x02,
- _Reg_Power_Cabinet_Status = 0x03,
- _Reg_Dispenser_Status = 0x04,
- _Reg_Charging_Capability = 0x05,
- _Reg_Charging_Target = 0x06,
- _Reg_Software_Update = 0x07,
- _Reg_Plug_In_Status = 0x08,
- _Reg_Connector_State = 0x09,
- _Reg_User_ID = 0x0A,
- _Reg_Charging_Permission = 0x0B,
- _Reg_Misc_Control = 0x0C,
- _Reg_Report_Csu_Version = 0x0D,
- _Reg_Report_Other_Version = 0x0E,
- _Reg_Charging_Info = 0x0F,
- _Reg_Charger_System_Id = 0x10,
- _Reg_WaitPlugIn = 0x11,
- };
- enum Response_Result
- {
- _R_OK = 0x01,
- _R_NG = 0x02,
- };
- enum Response_Upgrade
- {
- _R_NeedUpgrade = 0x01,
- _R_NoUpgrade = 0x02,
- };
- enum PlugIn_Status
- {
- _PIS_UnPlugged = 0x00,
- _PIS_PluggedIn = 0x01,
- };
- enum Connector_Remote_Status
- {
- _CRS_Idle = 0x00,
- _CRS_Preparing = 0x01,
- _CRS_Charging = 0x02,
- _CRS_Terminating = 0x03,
- };
- typedef enum
- {
- _DAS_NotAllowed = 0x00,
- _DAS_Allowed = 0x01,
- _DAS_Wait = 0x02,
- }DispenserAck_Status;
- enum Permission_Status
- {
- _PS_NotPermitted = 0x00,
- _PS_Permitted = 0x01,
- };
- enum Accept_Status
- {
- _AS_Reject = 0x00,
- _AS_Accept = 0x01,
- };
- struct HEADER_STRUCTURE
- {
- unsigned char se;
- unsigned char id;
- unsigned char op;
- unsigned char len;
- };
- struct PAYLOAD_STRUCTURE
- {
- unsigned char reg;
- unsigned char data[MAXIMUM_PAYLOAD_LENGTH];
- };
- struct PACKET_STRUCTURE
- {
- struct HEADER_STRUCTURE Header;
- struct PAYLOAD_STRUCTURE Payload;
- }Packet_Structure;
- enum DispenserStatus
- {
- _DS_None = 0x00,
- _DS_Identification = 0x01,
- _DS_Idle = 0x02,
- _DS_Alarm = 0x03,
- _DS_Charging = 0x04,
- _DS_Timeout = 0x05,
- };
- enum ConnectionStatus
- {
- _CNS_FREE = 0x00,
- _CNS_WaitModelName = 0x01,
- _CNS_DispenserMatched = 0x02,
- };
- struct MISC_COMMAND
- {
- unsigned short Command;
- unsigned int Value;
- };
- enum MiscCommand
- {
- _MiscCmd_None = 0x0000,
- _MiscCmd_ConnectorTimeout = 0x0001,
- _MiscCmd_ChangeOperative = 0x0002,
- _MiscCmd_DefaultPrice = 0x0003,
- _MiscCmd_Currency = 0x0004,
- _MiscCmd_AccountBalance = 0x0005,
- _MiscCmd_HardwareReboot = 0x0101,
- _MiscCmd_SoftwareRestart = 0x0102,
- _MiscCmd_RemoteStart = 0x0103,
- _MiscCmd_RemoteStop = 0x0104,
- _MiscCmd_UnlockStop = 0x0105,
- };
- struct ChargingCapabilityResponse
- {
- unsigned char ResponseResult;
- unsigned short MaxOuputVoltage;
- unsigned short MaxOuputCurrent;
- unsigned short MaxOuputPower;
- unsigned char Currency;
- unsigned int UserPrice;
- unsigned int TotalCost;
- int AccountBalance;
- };
- #endif
|