|
@@ -415,11 +415,12 @@ void CANReceiver()
|
|
|
//memcpy(&ShmSysConfigAndInfo->ate.vccu.controlPilotStatus, &frame.data, frame.can_dlc);
|
|
|
ShmSysConfigAndInfo->ate.vccu.controlPilotStatus.ControlPilot_Frequency.bits.VCCU_ControlPilot_Frequency = ((short) frame.data[1] << 8) + (short) frame.data[0];
|
|
|
ShmSysConfigAndInfo->ate.vccu.controlPilotStatus.ControlPilot_DutyCycle.bits.value = ((short) frame.data[2] ) ;
|
|
|
- ShmSysConfigAndInfo->ate.vccu.controlPilotStatus.ControlPilot_Voltage.bits.value = ((short) frame.data[3] << 8) + (short) frame.data[4];
|
|
|
+ ShmSysConfigAndInfo->ate.vccu.controlPilotStatus.ControlPilot_Voltage.bits.value = ((short) frame.data[4] << 8) + (short) frame.data[3];
|
|
|
ShmSysConfigAndInfo->ate.vccu.controlPilotStatus.DATA.bits.VCCU_ControlPilot_Wakeup = bitextract(((short) (frame.data[5])), 0, 2);
|
|
|
ShmSysConfigAndInfo->ate.vccu.controlPilotStatus.DATA.bits.VCCU_ChargeUnit_Mode = bitextract(frame.data[5],2, 5);
|
|
|
ShmSysConfigAndInfo->ate.vccu.controlPilotStatus.DATA.bits.VCCU_ChargeUnit_State = bitextract(((short) (frame.data[5])), 5, 8);
|
|
|
ShmSysConfigAndInfo->ate.vccu.controlPilotStatus.ChargeUnit_MaxCurrent = ((short) frame.data[6] );
|
|
|
+ //printf("ControlPilot_Voltage===== %d %02x %02x\n", (32000-ShmSysConfigAndInfo->ate.vccu.controlPilotStatus.ControlPilot_Voltage.bits.value), frame.data[4], frame.data[3]);
|
|
|
//memset(&ShmSysConfigAndInfo->ate.vccu.controlPilotStatus.ControlPilot_Voltage,frame.data[5], frame.can_dlc);
|
|
|
break;
|
|
|
}
|
|
@@ -1391,7 +1392,7 @@ int main(int argc, char *argv[])
|
|
|
}
|
|
|
case V_VOLTAGEDIFFERENCE:{
|
|
|
if (status){
|
|
|
- printf("CCS VOLTAGEDIFFERENCE Processing 10....................\n");
|
|
|
+ printf("CCS VOLTAGEDIFFERENCE Processing 10 VCCU_V2G_EVSEPresentVoltage_Va = %d ....................\n", ShmSysConfigAndInfo->ate.vccu.v2g_EVSEPresentVoltage.VCCU_V2G_EVSEPresentVoltage_Va);
|
|
|
}
|
|
|
setEVStatus1(evstaus[1]);
|
|
|
/*
|
|
@@ -1425,8 +1426,14 @@ int main(int argc, char *argv[])
|
|
|
|
|
|
|
|
|
}
|
|
|
+ //
|
|
|
setEVStatus1(evstaus[1]);
|
|
|
- VCCU_ChargeFromVehicle(CanFd, ShmSysConfigAndInfo->ate.linkVoltage, ShmSysConfigAndInfo->ate.vccu.v2g_EVSEPresentVoltage.VCCU_V2G_EVSEPresentVoltage_Va, Allowed, Not_Active, Allowed, Not_allowed, Closed);
|
|
|
+ if(ShmSysConfigAndInfo->ate.vccu.chargeToVehicle.bits.VCCU_Vehicle_ContactorRequest == Closed){
|
|
|
+ VCCU_ChargeFromVehicle(CanFd, ShmSysConfigAndInfo->ate.linkVoltage, ShmSysConfigAndInfo->ate.vccu.v2g_EVSEPresentVoltage.VCCU_V2G_EVSEPresentVoltage_Va, Allowed, Not_Active, Allowed, Not_allowed, Closed);
|
|
|
+ }else{
|
|
|
+ VCCU_ChargeFromVehicle(CanFd, ShmSysConfigAndInfo->ate.linkVoltage, ShmSysConfigAndInfo->ate.vccu.v2g_EVSEPresentVoltage.VCCU_V2G_EVSEPresentVoltage_Va, Allowed, Not_Active, Allowed, Not_allowed, Opened);
|
|
|
+
|
|
|
+ }
|
|
|
VCCU_V2G_VehicleStatus(CanFd, VCCU_V2G_StateM_EnergyTra_0000_DC_DC_extended, 0,
|
|
|
3, soc,
|
|
|
3, 3, TRUE,
|
|
@@ -1443,8 +1450,9 @@ int main(int argc, char *argv[])
|
|
|
case V_POWERDELIVERY:{
|
|
|
if (status){
|
|
|
printf("CCS POWERDELIVERY Processing 12....................\n");
|
|
|
+ //usleep(50000);
|
|
|
}
|
|
|
- VCCU_ChargeFromVehicle(CanFd, ShmSysConfigAndInfo->ate.linkVoltage, ShmSysConfigAndInfo->ate.linkVoltage, Allowed, Not_Active, Allowed, Not_allowed, Closed);
|
|
|
+ VCCU_ChargeFromVehicle(CanFd, ShmSysConfigAndInfo->ate.linkVoltage, ShmSysConfigAndInfo->ate.vccu.v2g_EVSEPresentVoltage.VCCU_V2G_EVSEPresentVoltage_Va, Allowed, Not_Active, Allowed, Not_allowed, Closed);
|
|
|
/*
|
|
|
if(ShmSysConfigAndInfo->ate.ATEStatus == 0){
|
|
|
VCCU_ChargeFromVehicle(CanFd, ShmSysConfigAndInfo->ate.linkVoltage, ShmSysConfigAndInfo->ate.vccu.v2g_EVSEPresentVoltage.VCCU_V2G_EVSEPresentVoltage_Va, Allowed, Not_Active, Allowed, Not_allowed, Closed);
|
|
@@ -1470,16 +1478,21 @@ int main(int argc, char *argv[])
|
|
|
}
|
|
|
case V_CURRENTDEMAND:{
|
|
|
if (status){
|
|
|
- printf("CCS CURRENTDEMAND Processing 13 %d....................\n", ShmSysConfigAndInfo->ate.vccu.v2g_EVSEPresentVoltage.VCCU_V2G_EVSEPresentVoltage_Va);
|
|
|
+ printf("CCS CURRENTDEMAND Processing 13 %d %d %d %d....................\n", ShmSysConfigAndInfo->ate.targetCurrent_Value, ShmSysConfigAndInfo->ate.targetVoltage_Value, ShmSysConfigAndInfo->ate.linkVoltage, ShmSysConfigAndInfo->ate.vccu.v2g_EVSEPresentVoltage.VCCU_V2G_EVSEPresentVoltage_Va);
|
|
|
//ShmSysConfigAndInfo->ate.linkVoltage = ShmSysConfigAndInfo->ate.vccu.v2g_EVSEPresentVoltage.VCCU_V2G_EVSEPresentVoltage_Va;
|
|
|
//printf("maximumVoltage_value = %d Voltage = %d maximumCurrent_value = %d Current = %d....................\n", ShmSysConfigAndInfo->ate.maximumVoltage_value, ShmSysConfigAndInfo->ate.targetVoltage_Value, ShmSysConfigAndInfo->ate.maximumCurrent_value, ShmSysConfigAndInfo->ate.targetCurrent_Value);
|
|
|
+ //usleep(50000);
|
|
|
}
|
|
|
+
|
|
|
setEVStatus1(evstaus[2]);
|
|
|
- if(ShmSysConfigAndInfo->ate.vccu.v2g_EVSEPresentVoltage.VCCU_V2G_EVSEPresentVoltage_Va <= 1){
|
|
|
- VCCU_ChargeFromVehicle(CanFd, ShmSysConfigAndInfo->ate.linkVoltage, ShmSysConfigAndInfo->ate.vccu.v2g_EVSEPresentVoltage.VCCU_V2G_EVSEPresentVoltage_Va, Not_allowed, Not_Active, Allowed, Not_allowed, Closed);
|
|
|
+ if(ShmSysConfigAndInfo->ate.vccu.chargeToVehicle.bits.VCCU_Vehicle_ContactorRequest == Opened){
|
|
|
+ printf("CCS CURRENTDEMAND Processing %d %d %d %d....................\n", ShmSysConfigAndInfo->ate.targetCurrent_Value, ShmSysConfigAndInfo->ate.targetVoltage_Value, ShmSysConfigAndInfo->ate.linkVoltage, ShmSysConfigAndInfo->ate.vccu.v2g_EVSEPresentVoltage.VCCU_V2G_EVSEPresentVoltage_Va);
|
|
|
+
|
|
|
+ //VCCU_ChargeFromVehicle(CanFd, ShmSysConfigAndInfo->ate.linkVoltage, ShmSysConfigAndInfo->ate.vccu.v2g_EVSEPresentVoltage.VCCU_V2G_EVSEPresentVoltage_Va, Not_allowed, Not_Active, Allowed, Not_allowed, Opened);
|
|
|
}else{
|
|
|
- VCCU_ChargeFromVehicle(CanFd, ShmSysConfigAndInfo->ate.linkVoltage, ShmSysConfigAndInfo->ate.vccu.v2g_EVSEPresentVoltage.VCCU_V2G_EVSEPresentVoltage_Va, Allowed, Not_Active, Allowed, Not_allowed, Closed);
|
|
|
+ //VCCU_ChargeFromVehicle(CanFd, ShmSysConfigAndInfo->ate.linkVoltage, ShmSysConfigAndInfo->ate.vccu.v2g_EVSEPresentVoltage.VCCU_V2G_EVSEPresentVoltage_Va, Allowed, Not_Active, Allowed, Not_allowed, Closed);
|
|
|
}
|
|
|
+ VCCU_ChargeFromVehicle(CanFd, ShmSysConfigAndInfo->ate.linkVoltage, ShmSysConfigAndInfo->ate.vccu.v2g_EVSEPresentVoltage.VCCU_V2G_EVSEPresentVoltage_Va, Allowed, Not_Active, Allowed, Not_allowed, Closed);
|
|
|
/*
|
|
|
if(ShmSysConfigAndInfo->ate.ATEStatus == 0){
|
|
|
//VCCU_ChargeFromVehicle(CanFd, 500, 500, Allowed, Not_Active, Allowed, Not_allowed, Closed);
|
|
@@ -1559,6 +1572,8 @@ int main(int argc, char *argv[])
|
|
|
setMisc(1, ShmSysConfigAndInfo->ate.chademo.id0D_req.K1K2Status, ShmSysConfigAndInfo->ate.chademo.id0D_req.Soc);
|
|
|
|
|
|
if(ShmSysConfigAndInfo->ate.ATEStatus == 1){
|
|
|
+ ShmSysConfigAndInfo->ate.Permission = START;
|
|
|
+ setChargerMode(CCS_QUANTITY, ShmSysConfigAndInfo->ate.Permission);
|
|
|
//ShmSysConfigAndInfo->ate.Permission = START;
|
|
|
//setChargerMode(CCS_QUANTITY, ShmSysConfigAndInfo->ate.Permission);
|
|
|
//printf("ATEStatus == 1 %d \n",ShmSysConfigAndInfo->ate.ATEStatus);
|
|
@@ -1665,14 +1680,17 @@ int main(int argc, char *argv[])
|
|
|
}
|
|
|
//SetChargingPermission(CCS_QUANTITY, ShmSysConfigAndInfo->ate.Permission, ShmSysConfigAndInfo->ate.TotalBatteryCap, ShmSysConfigAndInfo->ate.MaxBatteryCurrent, ShmSysConfigAndInfo->ate.MaxBatteryVoltage, 1);
|
|
|
//SetChargingPermission(CCS_QUANTITY, START, 1000, 1200, 6000, 1);
|
|
|
- //usleep(1000);
|
|
|
+ usleep(1000);
|
|
|
//給火線電壓
|
|
|
+ //07
|
|
|
SetPresentInputPower(ShmSysConfigAndInfo->ate.RequireVoltage, ShmSysConfigAndInfo->ate.RequireCurrent, 1);
|
|
|
- //usleep(1000);
|
|
|
+ usleep(1000);
|
|
|
//SetPresentInputRequirement(4800, 6000, 1920, 20);
|
|
|
SetPresentInputRequirement(ShmSysConfigAndInfo->ate.RequireVoltage, ShmSysConfigAndInfo->ate.RequireCurrent, ShmSysConfigAndInfo->ate.PresentBattVoltage, ShmSysConfigAndInfo->ate.MinimumChargeCurrent, 1);
|
|
|
|
|
|
}
|
|
|
+ }else if(ShmSysConfigAndInfo->ate.ATEState == 3){//chademo
|
|
|
+
|
|
|
}
|
|
|
|
|
|
}
|