|
@@ -264,6 +264,25 @@ void getNowDatetime(uint8_t *data)
|
|
|
sprintf((char*)data, "%04d-%02d-%02dT%02d:%02d:%02dZ", tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec);
|
|
|
}
|
|
|
|
|
|
+int qca7000FlashCheck()
|
|
|
+{
|
|
|
+ int result = FAIL;
|
|
|
+ char buf[256];
|
|
|
+ FILE *fp;
|
|
|
+
|
|
|
+ fp = popen("/usr/bin/plcID", "r");
|
|
|
+ if(fp != NULL)
|
|
|
+ {
|
|
|
+ while(fgets(buf, sizeof(buf), fp) != NULL)
|
|
|
+ {
|
|
|
+ if(strlen(buf) >= 10)result = PASS;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ pclose(fp);
|
|
|
+
|
|
|
+ return result;
|
|
|
+}
|
|
|
+
|
|
|
//==========================================
|
|
|
// Main process
|
|
|
//==========================================
|
|
@@ -1071,6 +1090,33 @@ int main(void)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ //=====================================
|
|
|
+ // QCA7000 flash content check
|
|
|
+ //=====================================
|
|
|
+ if(((gun_index == 0) && (ShmSysConfigAndInfo->SysConfig.ModelName[9] == '7')) ||
|
|
|
+ ((gun_index == 1) && (ShmSysConfigAndInfo->SysConfig.ModelName[8] == '7')) ||
|
|
|
+ ((gun_index == 2) && (ShmSysConfigAndInfo->SysConfig.ModelName[7] == '7')))
|
|
|
+ {
|
|
|
+ if(qca7000FlashCheck() == FAIL)
|
|
|
+ {
|
|
|
+ if(ShmStatusCodeData->AlarmCode.AlarmEvents.bits.CCSboardStestFail == OFF)
|
|
|
+ {
|
|
|
+ ShmStatusCodeData->AlarmCode.AlarmEvents.bits.CCSboardStestFail = ON;
|
|
|
+ ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode |= ALARM_QCA_FLASH_FAIL;
|
|
|
+ DEBUG_INFO("ALARM_QCA_FLASH_FAIL : alarm \n");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if(ShmStatusCodeData->AlarmCode.AlarmEvents.bits.CCSboardStestFail == ON)
|
|
|
+ {
|
|
|
+ ShmStatusCodeData->AlarmCode.AlarmEvents.bits.CCSboardStestFail = OFF;
|
|
|
+ ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode &= ~ALARM_QCA_FLASH_FAIL;
|
|
|
+ DEBUG_INFO("ALARM_QCA_FLASH_FAIL : recover \n");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
//=====================================
|
|
|
// OCPP error code message
|
|
|
//=====================================
|
|
@@ -1240,6 +1286,12 @@ int main(void)
|
|
|
sprintf((char*)ShmOCPP16Data->StatusNotification[gun_index].VendorErrorCode , "012345");
|
|
|
sprintf((char*)ShmOCPP16Data->StatusNotification[gun_index].Info , "PilotNegativeError");
|
|
|
}
|
|
|
+ else if(ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode & ALARM_QCA_FLASH_FAIL)
|
|
|
+ {
|
|
|
+ sprintf((char*)ShmOCPP16Data->StatusNotification[gun_index].ErrorCode , "OtherError");
|
|
|
+ sprintf((char*)ShmOCPP16Data->StatusNotification[gun_index].VendorErrorCode , "012284");
|
|
|
+ sprintf((char*)ShmOCPP16Data->StatusNotification[gun_index].Info , "QCA Self test Failed");
|
|
|
+ }
|
|
|
else
|
|
|
{
|
|
|
sprintf((char*)ShmOCPP16Data->StatusNotification[gun_index].ErrorCode , "NoError");
|
|
@@ -1985,6 +2037,30 @@ int main(void)
|
|
|
previousAlarmCode[gun_index] &= ~ALARM_CP_NEG_ERROR;
|
|
|
}
|
|
|
|
|
|
+ if((ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode & ALARM_QCA_FLASH_FAIL) != (previousAlarmCode[gun_index] & ALARM_QCA_FLASH_FAIL))
|
|
|
+ {
|
|
|
+ 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, "012284");
|
|
|
+ sprintf((char*)ShmOCPP20Data->NotifyEvent.eventData[idxEvent].techInfo, "QCA Self test Failed");
|
|
|
+
|
|
|
+ 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_QCA_FLASH_FAIL)
|
|
|
+ previousAlarmCode[gun_index] |= ALARM_QCA_FLASH_FAIL;
|
|
|
+ else
|
|
|
+ previousAlarmCode[gun_index] &= ~ALARM_QCA_FLASH_FAIL;
|
|
|
+ }
|
|
|
+
|
|
|
if(idxEvent > 0)
|
|
|
ShmOCPP20Data->SpMsg.bits.NotifyEventReq = ON;
|
|
|
}
|