123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316 |
- #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 IP_CONFLICTED_TIME 1000
- #define CONNECTION_LIMIT 5
- #define MAXIMUM_CONNECT_QUANTITY 4
- #define CCS_MAX_PHYSICAL_VOLTAGE 9500
- #define CCS_NATURAL_U_E_MAX_CURRENT 2000
- #define CCS_LIQUID_V_F_MAX_CURRENT 5000
- #define CCS_LIQUID_80_DERATING_1_CUR 4000
- #define CCS_LIQUID_85_DERATING_2_CUR 3000
- #define CCS_PANTOGRAPH_MAX_CURRENT 5000
- #define CCS_NATURAL_T_D_MAX_CURRENT 3000
- #define CCS_NATURAL_I_Q_BOOST_CURRENT 5000
- #define CCS_NATURAL_I_Q_MAX_CURRENT 3000
- #define CCS_NATURAL_I_Q_85_DERATING_CUR 1000
- #define CCS_NATURAL_Y_Z_MAX_CURRENT 1500
- #define CHA_MAX_PHYSICAL_VOLTAGE 5000
- #define CHA_NATURAL_K_MAX_CURRENT 2000
- #define CHA_NATURAL_J_MAX_CURRENT 1200
- #define CHA_NATURAL_J_JARI_MAX_CURRENT 1250
- #define CHA_NATURAL_S_MAX_CURRENT 1250
- #define CHA_NATURAL_S_BOOST_CURRENT 2000
- #define CHA_NATURAL_O_BOOST_CURRENT 3500
- #define CHA_NATURAL_O_MAX_CURRENT 2000
- #define GBT_MAX_PHYSICAL_VOLTAGE 7500
- #define GBT_NATURAL_MAX_CURRENT 2500
- #define AUTO_GUN_SELECTION_ID 0xFF
- 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_QR_Code_Date = 0x10,
- _Reg_WaitPlugIn = 0x11,
- _Reg_GroundFaultDetection = 0x12,
- _Reg_Get_Cabinet_CSU_Version = 0x13,
- _Reg_Get_Cabinet_Other_Version = 0x14,
- _Reg_Get_Psu_Quantity = 0x15,
- _Reg_Get_Psu_Version = 0x16,
- _Reg_Get_Reservation = 0x17,
- _Reg_Dispenser_Request = 0x18,
- _Reg_RemoteStartNoIDState = 0x19,
- _Reg_RefundAmount = 0x1A,
- _Reg_PrepaymentInfo = 0x1B,
- _Reg_PaymentFailReason = 0x1C,
- _Reg_ConnectorQRCode = 0x1D,
- _Reg_StationInfo = 0x1E,
- _Reg_DeductResult = 0x1F,
- _Reg_CabinetSystemID = 0x20,
- _Reg_DefaultPriceString = 0x21,
- _Reg_UserPriceString = 0x22,
- _Reg_Receipt = 0x23,
- _Reg_PowerConsumption = 0x24,
- _Reg_ChargingTimestamp = 0x25,
- _Reg_ChargingBill = 0x26,
- _Reg_ParkingStatus = 0x27,
- _Reg_ParkingBill = 0x28,
- _Reg_OCMF_Info = 0x29,
- _Reg_None = 0x2A,
- };
- 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,
- _CRS_Alarm = 0x04,
- };
- 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,
- };
- enum LcmPage
- {
- _LCM_None = 0x00,
- _LCM_Page_RemoteStartNoID = 0x01,
- };
- 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_BackendStatus = 0x0006,
- _MiscCmd_EthernetStatus = 0x0007,
- _MiscCmd_WiFiStatus = 0x0008,
- _MiscCmd_4GStatus = 0x0009,
- _MiscCmd_Billing = 0x000A,
- _MiscCmd_StopButton = 0x000B,
- _MiscCmd_AuthDisable = 0x000C,
- _MiscCmd_EVCCIDEnable = 0x000D,
- _MiscCmd_LEDIntensity = 0x000E,
- _MiscCmd_AcContactor = 0x000E,
- _MiscCmd_TimeOffset = 0x0010,
- _MiscCmd_ParkingPrice = 0x0011,
- _MiscCmd_RFIDCardEndian = 0x0012,
- _MiscCmd_RFIDEnable = 0x0013,
- _MiscCmd_HardwareReboot = 0x0101,
- _MiscCmd_SoftwareRestart = 0x0102,
- _MiscCmd_RemoteStart = 0x0103,
- _MiscCmd_RemoteStop = 0x0104,
- _MiscCmd_UnlockStop = 0x0105,
- _MiscCmd_Reservation = 0x0106,
- _MiscCmd_ChangeLcmPage = 0x0107,
- _MiscCmd_QRCodeRequest = 0x0108,
- _MiscCmd_StationInfo = 0x0109,
- _MiscCmd_FinalCost = 0x010A,
- _MiscCmd_LineStatus = 0x010B,
- _MiscCmd_DefaultPriceString = 0x010C,
- _MiscCmd_UserPriceString = 0x010D,
- _MiscCmd_Receipt = 0x010E,
- _MiscCmd_ChargingBill = 0x010F,
- _MiscCmd_ParkingRequest = 0x0110,
- };
- enum DispenserMisc_Request
- {
- _DisReq_None = 0x0000,
- _DisReq_ChargingCancel = 0x0001,
- _DisReq_ParkingFee = 0x0002,
- };
- typedef struct
- {
- unsigned char ResponseResult;
- unsigned short MaxOuputVoltage;
- unsigned short MaxOuputCurrent;
- unsigned short MaxOuputPower;
- unsigned char Currency;
- unsigned int UserPrice;
- unsigned int TotalCost;
- int AccountBalance;
- int CostDiscount;
- int TransactionId;
- int EnergyCost;
- int ParkingFee;
- int RemainAmount;
- char CurrencyString[4];
- }ChargingCapabilityResponseInfo;
- enum WaitPlug
- {
- _WaitPlug_None = 0x0,
- _WaitPlug_Start = 0x1,
- };
- enum GroundFaultDetection
- {
- _GFD_Disable = 0x0,
- _GFD_Enable = 0x1,
- };
- typedef struct
- {
- char ChargingDate[32];
- char Prepayment[32];
- char ActualCost[32];
- char RefundAmount[32];
- }RefundResponse;
- typedef struct
- {
- unsigned char PaymentType;
- char TopUp[32];
- char AccountAmount[32];
- char Prepayment[32];
- char Balance[32];
- }PrepaymentResponseInfo;
- typedef struct
- {
- unsigned char ReasonIndex;
- char Reason[128];
- }PaymentFailResponse;
- typedef struct
- {
- unsigned char ParkingStatus;
- char OccupancySn[37];
- }OccupancyResponse;
- #endif
|