|
@@ -155,7 +155,6 @@ struct StructConfigurationKey staticResponseConfigurationKeyArray[GetConfigurati
|
|
|
struct StructConfigurationKeyItems staticResponseUnknownKey[10]={0};
|
|
|
struct StructLocalAuthorizationList staticLocalAuthorizationList[1]={0};
|
|
|
|
|
|
-#if 0
|
|
|
static char *ChargePointErrorCodeStr[] = {
|
|
|
MACROSTR(ConnectorLockFailure),
|
|
|
MACROSTR(EVCommunicationError),
|
|
@@ -174,7 +173,6 @@ static char *ChargePointErrorCodeStr[] = {
|
|
|
MACROSTR(UnderVoltage),
|
|
|
MACROSTR(WeakSignal)
|
|
|
};
|
|
|
-#endif
|
|
|
|
|
|
static char * ChargePointStatusStr[] = {
|
|
|
MACROSTR(Available),
|
|
@@ -5703,6 +5701,7 @@ int sendStatusNotificationRequest(int gun_index)
|
|
|
char tempdata[65]={0};
|
|
|
int tempIndex = 0;
|
|
|
uint8_t isStateChanged = TRUE;
|
|
|
+ uint8_t isContentIllegal = TRUE;
|
|
|
|
|
|
DEBUG_INFO("sendStatusNotificationRequest...\n");
|
|
|
gettimeofday(&tmnow, NULL);
|
|
@@ -6060,6 +6059,21 @@ S_FAULT =12
|
|
|
memcpy(ShmOCPP16DataPH->StatusNotification[gun_index].ErrorCode, ShmOCPP16Data->StatusNotification[gun_index].ErrorCode, ARRAY_SIZE(ShmOCPP16DataPH->StatusNotification[gun_index].ErrorCode));
|
|
|
memcpy(ShmOCPP16DataPH->StatusNotification[gun_index].VendorErrorCode, ShmOCPP16Data->StatusNotification[gun_index].VendorErrorCode, ARRAY_SIZE(ShmOCPP16DataPH->StatusNotification[gun_index].VendorErrorCode));
|
|
|
|
|
|
+ isContentIllegal = TRUE;
|
|
|
+ for(int index = 0; index < ARRAY_SIZE(ChargePointErrorCodeStr); index++)
|
|
|
+ {
|
|
|
+ if(strcmp((char *)ShmOCPP16DataPH->StatusNotification[gun_index].ErrorCode, ChargePointErrorCodeStr[index])==0)
|
|
|
+ {
|
|
|
+ isContentIllegal = FALSE;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(isContentIllegal)
|
|
|
+ {
|
|
|
+ //DEBUG_WARN("Detect illegal ErrorCode: %s \n",(char *)ShmOCPP16Data->StatusNotification[gun_index].ErrorCode);
|
|
|
+ strcpy((char *)ShmOCPP16DataPH->StatusNotification[gun_index].ErrorCode, ChargePointErrorCodeStr[6]);
|
|
|
+ }
|
|
|
+
|
|
|
random_uuid(guid);
|
|
|
|
|
|
sprintf(message, "[%d,\"%s\",\"StatusNotification\",{\"connectorId\":%d,\"errorCode\":\"%s\",\"info\":\"%s\",\"status\":\"%s\",\"timestamp\":\"%s\",\"vendorId\":\"%s\",\"vendorErrorCode\":\"%s\"}]"
|