123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246 |
- #ifndef EVCOMM_H_
- #define EVCOMM_H_
- #if FIRMWARE_VERSION_COMPILE_SETTING_RELEASE_MODE == ENABLE
- #define SAVE_SYS_LOG_MSG_EVCOMM_SWITCH ENABLE
- #define DEBUG_PRINTF_EVCOMM_SHOW DISABLE
- #define DEBUG_PRINTF_EVCOMM_BRIEF_SHOW DISABLE
- #define DEBUG_PRINTF_EVCOMM_DETAIL_SHOW DISABLE
- #define DEBUG_PRINTF_EVCOMM_SYSTEM_LOG_SHOW DISABLE
- #else
- #define SAVE_SYS_LOG_MSG_EVCOMM_SWITCH ENABLE
- #define DEBUG_PRINTF_EVCOMM_SHOW ENABLE
- #define DEBUG_PRINTF_EVCOMM_BRIEF_SHOW DISABLE
- #define DEBUG_PRINTF_EVCOMM_DETAIL_SHOW DISABLE
- #define DEBUG_PRINTF_EVCOMM_SYSTEM_LOG_SHOW ENABLE
- #endif
- #define ADC_CHANNEL_AIN0_NTC1 0
- #define ADC_CHANNEL_AIN1_NTC2 1
- #define ADC_CHANNEL_AIN2_PP 2
- #define ADC_CHANNEL_AIN3_CP 3
- #define QcaInterface "eth1"
- #define SUPPORT_BCB_TOGGLE_FUNCTION ENABLE
- #define SdpUdpServerPort 15118
- #define SdpTcpServerPort 50000
- #define IPV6_LINK_LOCAL_PREFIX 0xFE80
- #define V2GTP_MSG_RX_BUFFER_SIZE (64*1024)
- #define V2GTP_MSG_TX_BUFFER_SIZE (64*1024)
- #define V2GTP_MSG_HEADER_LENGTH 8
- #define EtherType_HomePlug 0x88E1
- #define MMTYPE_CM_SET_KEY_REQ 0x6008
- #define MMTYPE_CM_SET_KEY_CNF 0x6009
- #define MMTYPE_CM_AMP_MAP_REQ 0x601C
- #define MMTYPE_CM_AMP_MAP_CNF 0x601D
- #define MMTYPE_CM_SLAC_PARM_REQ 0x6064
- #define MMTYPE_CM_SLAC_PARM_CNF 0x6065
- #define MMTYPE_CM_START_ATTEN_CHAR_IND 0x606A
- #define MMTYPE_CM_MNBC_SOUND_IND 0x6076
- #define MMTYPE_CM_ATTEN_CHAR_IND 0x606E
- #define MMTYPE_CM_ATTEN_CHAR_RSP 0x606F
- #define MMTYPE_CM_VALIDATE_REQ 0x6078
- #define MMTYPE_CM_VALIDATE_CNF 0x6079
- #define MMTYPE_CM_SLAC_MATCH_REQ 0x607C
- #define MMTYPE_CM_SLAC_MATCH_CNF 0x607D
- #define MMTYPE_CM_ATTEN_PROFILE_IND 0x6086
- #define MMTYPE_VENDOR_VS_HOST_ACTION 0xA062
- #define MMTYPE_VENDOR_ATTEN_CHAR 0xA14E
- #define MMTYPE_VENDOR_VS_NW_INFO 0xA038
- #define MMTYPE_VENDOR_VS_NW_INFO_CNF 0xA039
- #define MMTYPE_VENDOR_VS_PL_LNK_STATUS 0xA0B8
- #define MMTYPE_VENDOR_VS_PL_LNK_STATUS_CNF 0xA0B9
- #define V2GTP_PAYLOAD_TYPE_SDP_REQUEST 0x9000
- #define V2GTP_PAYLOAD_TYPE_SDP_RESPONSE 0x9001
- #define V2GTP_PAYLOAD_TYPE_EXI_MSG 0x8001
- #define SDP_PAYLOAD_SECURITY_TLS 0x00
- #define SDP_PAYLOAD_SECURITY_NONE 0x10
- #define SDP_PAYLOAD_TRANS_PROTOCOL_TCP 0x00
- #define SDP_PAYLOAD_TRANS_PROTOCOL_UDP 0x10
- #define TT_EVSE_match_MNBC (600+400)
- #define C_EV_match_MNBC 0x0A
- #define TT_EVSE_SLAC_init 50
- #define TT_match_sequence 400
- #define TP_match_response 100
- #ifdef DIN70122_ISO15118_VERIFICATION
- #define TT_match_response (200)
- #else
- #define TT_match_response (200)
- #endif
- #define TP_EV_batch_msg_interval (50*3)
- #define TT_EVSE_match_session 10000
- #define TT_match_join (12000*2)
- #define V2G_SECC_ReadyToCharge_Performance_Time 148000
- #define V2G_SECC_CommunicationSetup_Performance_Time 18000
- #define V2G_SECC_ChargingParameter_Performance_Time 60000
- #define V2G_SECC_CableCheck_Performance_Time 38000
- #define V2G_SECC_PreCharge_Performance_Time 10000
- #define V2G_SECC_WeldingDetection_Performance_Time 20000
- #define V2G_SECC_CPState_Detection_Timeout 1500
- #define V2G_SECC_CPOscillator_Retain_Timeout 1500
- #define V2G_EVCC_Msg_Timeout_SupportedAppProtocolReq 2000
- #define V2G_EVCC_Msg_Timeout_SessionSetupReq 2000
- #define V2G_EVCC_Msg_Timeout_ServiceDiscoveryReq 2000
- #define V2G_EVCC_Msg_Timeout_ServicePaymentSelectionReq 2000
- #define V2G_EVCC_Msg_Timeout_ContractAuthenticationReq 2000
- #define V2G_EVCC_Msg_Timeout_ChargeParameterDiscoveryReq 2000
- #define V2G_EVCC_Msg_Timeout_PowerDeliveryReq 2000
- #define V2G_EVCC_Msg_Timeout_CableCheckReq 2000
- #define V2G_EVCC_Msg_Timeout_PreChargeReq 2000
- #define V2G_EVCC_Msg_Timeout_CurrentDemandReq 25
- #define V2G_EVCC_Msg_Timeout_WeldingDetectionReq 2000
- #define V2G_EVCC_Msg_Timeout_SessionStopReq 2000
- #define V2G_SECC_Sequence_Timeout 60000
- #define V2G_SECC_QCA7000_GET_MAC_ADDR_REQ_RETRY_PERIOD 3000
- #define V2G_SECC_QCA7000_SEND_SET_KEY_PERIOD 2000
- #define V2G_SECC_QCA7000_COMM_TIMEOUT 10000
- #define V2G_SECC_CP_Timeout_CableCheck 2000
- #define DIN_SPEC_70121_2012_VersionNumberMajor 2
- #define DIN_SPEC_70121_2012_VersionNumberMinor 0
- #define ISO1_15118_2013_VersionNumberMajor 2
- #define ISO1_15118_2013_VersionNumberMinor 0
- #define ISO2_15118_2018_VersionNumberMajor 3
- #define ISO2_15118_2018_VersionNumberMinor 0
- struct MmeHeader
- {
- unsigned char ODA[6];
- unsigned char OSA[6];
-
- unsigned short MTYPE;
- unsigned char MMV;
- unsigned short MMTYPE;
- unsigned char FMI[2];
- unsigned char MMENTRY[256];
- } __attribute__((packed));
- struct QcaVendorMmeHeader
- {
- unsigned char ODA[6];
- unsigned char OSA[6];
-
- unsigned short MTYPE;
- unsigned char MMV;
- unsigned short MMTYPE;
- unsigned char OUI[3];
- unsigned char MBODY[1024];
- } __attribute__((packed));
- struct V2gtpHeader //8 Bytes (see Figure 25 in DIN 70121)
- {
- unsigned char ProtocolVersion;
- unsigned char InverseProtocolVersion;
- unsigned short PayloadType;
-
-
-
- unsigned int PayloadLength;
- } __attribute__((packed));
- int Proc_din_supportedAppProtocolRes(int AcceptFd);
- void SHM_Init_din_ChargeParameterDiscoveryRes(struct CcsData *shm_ccs);
- void SHM_Init_din_CableCheckRes(struct CcsData *shm_ccs);
- void SHM_Init_din_PreChargeRes(struct CcsData *shm_ccs);
- void SHM_Init_din_PowerDeliveryRes(struct CcsData *shm_ccs);
- void SHM_Init_din_CurrentDemandRes(struct CcsData *shm_ccs);
- void SHM_Init_din_WeldingDetectionRes(struct CcsData *shm_ccs);
- void SHM_Init_din_SessionStopRes(struct CcsData *shm_ccs);
- int OutputCpPwmDuty(unsigned char Duty);
- void Check_EVErrorCode(int code);
- unsigned char Check_V2G_Flow_Status_pre();
- int End_Process();
- int SdpUdpConnected();
- int V2gTcpConnected();
- #if SAVE_SYS_LOG_MSG_EVCOMM_SWITCH == ENABLE
- #define SAVE_SYS_LOG_MSG_EVCOMM StoreLogMsg2
- #else
- #define SAVE_SYS_LOG_MSG_EVCOMM(...)
- #endif
- #if DEBUG_PRINTF_EVCOMM_SHOW == ENABLE
-
- #if DEBUG_PRINTF_EVCOMM_BRIEF_SHOW == ENABLE
- #define DEBUG_PRINTF_EVCOMM_BRIEF printf
- #else
- #define DEBUG_PRINTF_EVCOMM_BRIEF(...)
- #endif
-
- #if DEBUG_PRINTF_EVCOMM_DETAIL_SHOW == ENABLE
- #define DEBUG_PRINTF_EVCOMM_DETAIL printf
- #else
- #define DEBUG_PRINTF_EVCOMM_DETAIL(...)
- #endif
-
- #if DEBUG_PRINTF_EVCOMM_SYSTEM_LOG_SHOW == ENABLE
- #define DEBUG_PRINTF_EVCOMM_SYSTEM_LOG printf
- #else
- #define DEBUG_PRINTF_EVCOMM_SYSTEM_LOG(...)
- #endif
- #else
- #define DEBUG_PRINTF_EVCOMM_BRIEF(...)
- #define DEBUG_PRINTF_EVCOMM_DETAIL(...)
- #define DEBUG_PRINTF_EVCOMM_SYSTEM_LOG(...)
- #endif
- #endif
|