|
@@ -1008,7 +1008,7 @@ int main(void)
|
|
|
//=====================================
|
|
|
// Meter communication timeout detection
|
|
|
//=====================================
|
|
|
- if(ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.meter_comm_timeout)
|
|
|
+ if(ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.meter_comm_timeout == ON)
|
|
|
{
|
|
|
if(ShmStatusCodeData->AlarmCode.AlarmEvents.bits.MeterCommTimeout == OFF)
|
|
|
{
|
|
@@ -1027,6 +1027,50 @@ int main(void)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ //=====================================
|
|
|
+ // Meter ic communication timeout detection
|
|
|
+ //=====================================
|
|
|
+ if(ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.meter_ic_comm_timeout == ON)
|
|
|
+ {
|
|
|
+ if(ShmStatusCodeData->AlarmCode.AlarmEvents.bits.MeterIcCommTimeout == OFF)
|
|
|
+ {
|
|
|
+ ShmStatusCodeData->AlarmCode.AlarmEvents.bits.MeterIcCommTimeout = ON;
|
|
|
+ ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode |= ALARM_METER_IC_TIMEOUT;
|
|
|
+ DEBUG_INFO("ALARM_METER_IC_TIMEOUT : alarm \n");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if(ShmStatusCodeData->AlarmCode.AlarmEvents.bits.MeterIcCommTimeout == ON)
|
|
|
+ {
|
|
|
+ ShmStatusCodeData->AlarmCode.AlarmEvents.bits.MeterIcCommTimeout = OFF;
|
|
|
+ ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode &= ~ALARM_METER_IC_TIMEOUT;
|
|
|
+ DEBUG_INFO("ALARM_METER_IC_TIMEOUT : recover \n");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //=====================================
|
|
|
+ // Pilot negative error detection
|
|
|
+ //=====================================
|
|
|
+ if(ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.pilot_negative_error == ON)
|
|
|
+ {
|
|
|
+ if(ShmStatusCodeData->AlarmCode.AlarmEvents.bits.PilotNegativeError == OFF)
|
|
|
+ {
|
|
|
+ ShmStatusCodeData->AlarmCode.AlarmEvents.bits.PilotNegativeError = ON;
|
|
|
+ ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode |= ALARM_CP_NEG_ERROR;
|
|
|
+ DEBUG_INFO("ALARM_PILOT_NEGATIVE_ERROR : alarm \n");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if(ShmStatusCodeData->AlarmCode.AlarmEvents.bits.PilotNegativeError == ON)
|
|
|
+ {
|
|
|
+ ShmStatusCodeData->AlarmCode.AlarmEvents.bits.PilotNegativeError = OFF;
|
|
|
+ ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode &= ~ALARM_CP_NEG_ERROR;
|
|
|
+ DEBUG_INFO("ALARM_PILOT_NEGATIVE_ERROR : recover \n");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
//=====================================
|
|
|
// OCPP error code message
|
|
|
//=====================================
|
|
@@ -1184,6 +1228,18 @@ int main(void)
|
|
|
sprintf((char*)ShmOCPP16Data->StatusNotification[gun_index].VendorErrorCode , "012305");
|
|
|
sprintf((char*)ShmOCPP16Data->StatusNotification[gun_index].Info , "MeterCommunicationTimeout");
|
|
|
}
|
|
|
+ else if(ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode & ALARM_METER_IC_TIMEOUT)
|
|
|
+ {
|
|
|
+ sprintf((char*)ShmOCPP16Data->StatusNotification[gun_index].ErrorCode , "OtherError");
|
|
|
+ sprintf((char*)ShmOCPP16Data->StatusNotification[gun_index].VendorErrorCode , "012344");
|
|
|
+ sprintf((char*)ShmOCPP16Data->StatusNotification[gun_index].Info , "MeterIcCommunicationTimeout");
|
|
|
+ }
|
|
|
+ else if(ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode & ALARM_CP_NEG_ERROR)
|
|
|
+ {
|
|
|
+ sprintf((char*)ShmOCPP16Data->StatusNotification[gun_index].ErrorCode , "OtherError");
|
|
|
+ sprintf((char*)ShmOCPP16Data->StatusNotification[gun_index].VendorErrorCode , "012345");
|
|
|
+ sprintf((char*)ShmOCPP16Data->StatusNotification[gun_index].Info , "PilotNegativeError");
|
|
|
+ }
|
|
|
else
|
|
|
{
|
|
|
sprintf((char*)ShmOCPP16Data->StatusNotification[gun_index].ErrorCode , "NoError");
|
|
@@ -1881,6 +1937,54 @@ int main(void)
|
|
|
previousAlarmCode[gun_index] &= ~ALARM_METER_TIMEOUT;
|
|
|
}
|
|
|
|
|
|
+ if((ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode & ALARM_METER_IC_TIMEOUT) != (previousAlarmCode[gun_index] & ALARM_METER_IC_TIMEOUT))
|
|
|
+ {
|
|
|
+ getNowDatetime(ShmOCPP20Data->NotifyEvent.eventData[idxEvent].timestamp);
|
|
|
+ ShmOCPP20Data->NotifyEvent.eventData[idxEvent].eventId = idxEvent;
|
|
|
+ sprintf((char*)ShmOCPP20Data->NotifyEvent.eventData[idxEvent].trigger, "Alerting");
|
|
|
+ sprintf((char*)ShmOCPP20Data->NotifyEvent.eventData[idxEvent].actualValue, ((ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode & ALARM_METER_IC_TIMEOUT)?"true":"false"));
|
|
|
+ ShmOCPP20Data->NotifyEvent.eventData[idxEvent].cleared = ((ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode & ALARM_METER_IC_TIMEOUT)?OFF:ON);
|
|
|
+ sprintf((char*)ShmOCPP20Data->NotifyEvent.eventData[idxEvent].eventNotificationType, "HardWiredNotification");
|
|
|
+
|
|
|
+ sprintf((char*)ShmOCPP20Data->NotifyEvent.eventData[idxEvent].techcode, "012344");
|
|
|
+ sprintf((char*)ShmOCPP20Data->NotifyEvent.eventData[idxEvent].techInfo, "Meter ic communication timeout");
|
|
|
+
|
|
|
+ sprintf((char*)ShmOCPP20Data->NotifyEvent.eventData[idxEvent].component.name, "Meter");
|
|
|
+ ShmOCPP20Data->NotifyEvent.eventData[idxEvent].component.evse.connectorId = (gun_index+1);
|
|
|
+ sprintf((char*)ShmOCPP20Data->NotifyEvent.eventData[idxEvent].variable.name, "Problem");
|
|
|
+
|
|
|
+ idxEvent += ((idxEvent<ARRAY_SIZE(ShmOCPP20Data->NotifyEvent.eventData)-1)?1:0);
|
|
|
+
|
|
|
+ if(ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode & ALARM_METER_IC_TIMEOUT)
|
|
|
+ previousAlarmCode[gun_index] |= ALARM_METER_IC_TIMEOUT;
|
|
|
+ else
|
|
|
+ previousAlarmCode[gun_index] &= ~ALARM_METER_IC_TIMEOUT;
|
|
|
+ }
|
|
|
+
|
|
|
+ if((ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode & ALARM_CP_NEG_ERROR) != (previousAlarmCode[gun_index] & ALARM_CP_NEG_ERROR))
|
|
|
+ {
|
|
|
+ getNowDatetime(ShmOCPP20Data->NotifyEvent.eventData[idxEvent].timestamp);
|
|
|
+ ShmOCPP20Data->NotifyEvent.eventData[idxEvent].eventId = idxEvent;
|
|
|
+ sprintf((char*)ShmOCPP20Data->NotifyEvent.eventData[idxEvent].trigger, "Alerting");
|
|
|
+ sprintf((char*)ShmOCPP20Data->NotifyEvent.eventData[idxEvent].actualValue, ((ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode & ALARM_CP_NEG_ERROR)?"true":"false"));
|
|
|
+ ShmOCPP20Data->NotifyEvent.eventData[idxEvent].cleared = ((ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode & ALARM_CP_NEG_ERROR)?OFF:ON);
|
|
|
+ sprintf((char*)ShmOCPP20Data->NotifyEvent.eventData[idxEvent].eventNotificationType, "HardWiredNotification");
|
|
|
+
|
|
|
+ sprintf((char*)ShmOCPP20Data->NotifyEvent.eventData[idxEvent].techcode, "012345");
|
|
|
+ sprintf((char*)ShmOCPP20Data->NotifyEvent.eventData[idxEvent].techInfo, "Pilot negative error");
|
|
|
+
|
|
|
+ sprintf((char*)ShmOCPP20Data->NotifyEvent.eventData[idxEvent].component.name, "PCBA");
|
|
|
+ ShmOCPP20Data->NotifyEvent.eventData[idxEvent].component.evse.connectorId = (gun_index+1);
|
|
|
+ sprintf((char*)ShmOCPP20Data->NotifyEvent.eventData[idxEvent].variable.name, "Problem");
|
|
|
+
|
|
|
+ idxEvent += ((idxEvent<ARRAY_SIZE(ShmOCPP20Data->NotifyEvent.eventData)-1)?1:0);
|
|
|
+
|
|
|
+ if(ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode & ALARM_CP_NEG_ERROR)
|
|
|
+ previousAlarmCode[gun_index] |= ALARM_CP_NEG_ERROR;
|
|
|
+ else
|
|
|
+ previousAlarmCode[gun_index] &= ~ALARM_CP_NEG_ERROR;
|
|
|
+ }
|
|
|
+
|
|
|
if(idxEvent > 0)
|
|
|
ShmOCPP20Data->SpMsg.bits.NotifyEventReq = ON;
|
|
|
}
|