|
@@ -58,7 +58,7 @@ struct appHandEXIDocument ccs_handshake;
|
|
|
struct dinEXIDocument ccs_exi_doc_DIN;
|
|
|
struct iso1EXIDocument ccs_exi_doc_ISO1;
|
|
|
struct iso2EXIDocument ccs_exi_doc_ISO2;
|
|
|
-unsigned char V2GTP_Tx_buf[V2GTP_MSG_TX_BUFFER_SIZE]; //64*1024 嚘�65,536 = 65.5KB
|
|
|
+unsigned char V2GTP_Tx_buf[V2GTP_MSG_TX_BUFFER_SIZE]; //64*1024 ﺿ65,536 = 65.5KB
|
|
|
unsigned char buf_log_evcomm[SIZE_OF_LOG_BUFFER];
|
|
|
unsigned char buf_log_evcomm_fork1[SIZE_OF_LOG_BUFFER];
|
|
|
unsigned char buf_log_evcomm_fork2[SIZE_OF_LOG_BUFFER];
|
|
@@ -1477,7 +1477,7 @@ void CP_Detection()
|
|
|
|
|
|
#if ((CCS_ENERGY_TRANSFER_MODE == MODE_AC_SINGLE_PHASE_CORE) || (CCS_ENERGY_TRANSFER_MODE == MODE_AC_THREE_PHASE_CORE))
|
|
|
{
|
|
|
- usleep(10000);
|
|
|
+ usleep(100000);
|
|
|
ccs->CpVoltage = ShmInternalComm->AC_CpPositiveVoltage;
|
|
|
ccs->CpState = ShmInternalComm->AC_CpPresentState;
|
|
|
}
|
|
@@ -1642,7 +1642,7 @@ void CP_Detection()
|
|
|
Check_CP_State_Update_fork1(ccs);
|
|
|
#ifndef AX80
|
|
|
Check_CP_State_Error_fork1(ccs);
|
|
|
- #endif
|
|
|
+ #endif
|
|
|
//Updating Plugin status
|
|
|
#if (PP_PROTECTION_MECHANISM == ENABLE)
|
|
|
if((ccs->CpState >= 2 ) && (ccs->CpState <= 5 ) &&
|
|
@@ -1726,6 +1726,7 @@ void PP_Detection()
|
|
|
EVCOMM_SYS_INFO.PpVoltage_pre = EVCOMM_SYS_INFO.PpVoltage;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
#if 0
|
|
|
sleep(5);
|
|
|
printf("V_pp = %.02f\n", TotalTmpVolt);
|
|
@@ -2043,7 +2044,7 @@ void Error_Monitor()
|
|
|
Update_V2G_Flow_Status(Other_Fault);
|
|
|
End_Process();
|
|
|
}
|
|
|
- usleep(100000);
|
|
|
+ usleep(100000);
|
|
|
}//while
|
|
|
}
|
|
|
|
|
@@ -2070,12 +2071,12 @@ int SendSetKey()
|
|
|
SendMmePacket.MMTYPE = MMTYPE_CM_SET_KEY_REQ;
|
|
|
SendMmePacket.FMI[0] = SendMmePacket.FMI[1] = 0;
|
|
|
SendMmePacketSize = 0;
|
|
|
- SendMmePacket.MMENTRY[SendMmePacketSize++] = 0x01;//Fixed value (0x01) to indicate 嚙踝蕭NMK嚙踝蕭
|
|
|
+ SendMmePacket.MMENTRY[SendMmePacketSize++] = 0x01;//Fixed value (0x01) to indicate ��NMK��
|
|
|
memset(SendMmePacket.MMENTRY+SendMmePacketSize,0,4);//My Nonce, Fixed value(0x00000000), encrypted payload not used
|
|
|
SendMmePacketSize+=4;
|
|
|
memset(SendMmePacket.MMENTRY+SendMmePacketSize,0,4);//Your Nonce, Fixed value(0x00000000), encrypted payload not used
|
|
|
SendMmePacketSize+=4;
|
|
|
- SendMmePacket.MMENTRY[SendMmePacketSize++] = 0x04;//PID, Fixed value (0x04) to indicate 嚙踝蕭HLE protocol嚙踝蕭
|
|
|
+ SendMmePacket.MMENTRY[SendMmePacketSize++] = 0x04;//PID, Fixed value (0x04) to indicate ��HLE protocol��
|
|
|
memset(SendMmePacket.MMENTRY+SendMmePacketSize,0,2);//PRN, Fixed value(0x00), encrypted payload not used
|
|
|
SendMmePacketSize+=2;
|
|
|
SendMmePacket.MMENTRY[SendMmePacketSize++] = 0x00;//PMN, Fixed value(0x00) encrypted payload not used
|
|
@@ -2107,7 +2108,7 @@ int SendSetKey()
|
|
|
HPAVKeyNID(Nid,NewNmkKey,DEFAULT_LEVEL);
|
|
|
memcpy(SendMmePacket.MMENTRY+SendMmePacketSize,Nid,sizeof(Nid)); //NID, 54 LSBs contain the NID 2 MSBs = 0b00
|
|
|
SendMmePacketSize+=sizeof(Nid);
|
|
|
- SendMmePacket.MMENTRY[SendMmePacketSize++]=0x01;//NewEKS,Fixed value (0x01)to indicate 嚙踝蕭NMK嚙踝蕭
|
|
|
+ SendMmePacket.MMENTRY[SendMmePacketSize++]=0x01;//NewEKS,Fixed value (0x01)to indicate ��NMK��
|
|
|
memcpy(SendMmePacket.MMENTRY+SendMmePacketSize,NewNmkKey,sizeof(NewNmkKey));//NewKey
|
|
|
SendMmePacketSize += sizeof(NewNmkKey);
|
|
|
SendMmePacketSize += 19; //the size before MMENTRY
|
|
@@ -3256,9 +3257,9 @@ int MmeProcess(unsigned char *Buffer, int DataLength)
|
|
|
#if (DEBUG_PRINTF_EVCOMM_DETAIL_SHOW == ENABLE)
|
|
|
{
|
|
|
DEBUG_PRINTF_EVCOMM_DETAIL("--- MMTYPE_CM_VALIDATE_REQ ---\n");
|
|
|
- DEBUG_PRINTF_EVCOMM_DETAIL("Signal Type: 0x%x\n", MmePacket->MMENTRY[0]); //Fixed value (0x00) to indicate 嚙踝蕭PEV S2 toggles on control pilot line嚙踝蕭
|
|
|
+ DEBUG_PRINTF_EVCOMM_DETAIL("Signal Type: 0x%x\n", MmePacket->MMENTRY[0]); //Fixed value (0x00) to indicate ��PEV S2 toggles on control pilot line��
|
|
|
DEBUG_PRINTF_EVCOMM_DETAIL("Timer: 0x%x\n", MmePacket->MMENTRY[1]); //Fixed value In the first VALIDATE Request-Response exchange, the Timer field shall be set to zero.
|
|
|
- DEBUG_PRINTF_EVCOMM_DETAIL("Result: 0x%x\n", MmePacket->MMENTRY[2]); //Fixed value In the first VALIDATE Request-Response exchange, the Result field shall be set to 0x01 = 嚙踝蕭ready嚙踝蕭.
|
|
|
+ DEBUG_PRINTF_EVCOMM_DETAIL("Result: 0x%x\n", MmePacket->MMENTRY[2]); //Fixed value In the first VALIDATE Request-Response exchange, the Result field shall be set to 0x01 = ��ready��.
|
|
|
}
|
|
|
#endif
|
|
|
|
|
@@ -3404,7 +3405,7 @@ int MmeProcess(unsigned char *Buffer, int DataLength)
|
|
|
}
|
|
|
if(DiffTimeb(SeqStartTime, SeqEndTime) >= (SendMmePacket.MMENTRY[1]*100 + 100))
|
|
|
{
|
|
|
- SendMmePacket.MMENTRY[SendMmePacketSize++] = 0; //Fixed value to indicate 嚙踝蕭PEV S2 toggles on control pilot line嚙踝蕭
|
|
|
+ SendMmePacket.MMENTRY[SendMmePacketSize++] = 0; //Fixed value to indicate ��PEV S2 toggles on control pilot line��
|
|
|
SendMmePacket.MMENTRY[SendMmePacketSize++] = ToggleNum;
|
|
|
#if (SUPPORT_BCB_TOGGLE_FUNCTION == ENABLE)
|
|
|
SendMmePacket.MMENTRY[SendMmePacketSize++] = 2; //0x02 = Success
|
|
@@ -4220,8 +4221,8 @@ int SlacComm()
|
|
|
PwmStartTime = time(NULL);
|
|
|
}
|
|
|
else
|
|
|
- {
|
|
|
- if((time(NULL) - PwmStartTime) > TT_EVSE_SLAC_init)
|
|
|
+ {
|
|
|
+ if((time(NULL) - PwmStartTime) > ((CCS_ENERGY_TRANSFER_MODE<=1)?20:TT_EVSE_SLAC_init))
|
|
|
{
|
|
|
sprintf(buf_log_evcomm,
|
|
|
"SlacComm: Wait CM_SLAC_PARM_REQ Timeout - TT_EVSE_SLAC_init, NowTime(%d)-PwmStartTime(%d)>%d (sec)",
|
|
@@ -17799,8 +17800,18 @@ int main(int argc, char *argv[])
|
|
|
|
|
|
//Init Energy transfer mode
|
|
|
//[To-Do] Parsing Model Name
|
|
|
- ShmCcsData->EnergyTransferMode = CCS_ENERGY_TRANSFER_MODE;
|
|
|
-
|
|
|
+ if(CCS_ENERGY_TRANSFER_MODE<=1)
|
|
|
+ {
|
|
|
+ if((ShmInternalComm->AC_EVSEModelName[2]=='Y') || (ShmInternalComm->AC_EVSEModelName[2]=='D') || (ShmInternalComm->AC_EVSEModelName[2]=='W'))
|
|
|
+ //if(ShmSysConfigAndInfo->SysConfig.AcPhaseCount==3)
|
|
|
+ ShmCcsData->EnergyTransferMode = MODE_AC_THREE_PHASE_CORE;
|
|
|
+ else
|
|
|
+ ShmCcsData->EnergyTransferMode = MODE_AC_SINGLE_PHASE_CORE;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ ShmCcsData->EnergyTransferMode = CCS_ENERGY_TRANSFER_MODE;
|
|
|
+
|
|
|
+
|
|
|
struct ChargingInfoData *ccs;
|
|
|
ccs = &ShmSysConfigAndInfo->SysInfo.CcsChargingData[0];
|
|
|
|