|
@@ -5078,6 +5078,15 @@ void CheckSystemValue(void)
|
|
|
memset(&ShmOCPP16Data->SessionTarget[gun_index], 0x00, sizeof(struct StructSessionTarget));
|
|
|
}
|
|
|
|
|
|
+ //==========================================
|
|
|
+ // Charger OCMF message
|
|
|
+ //==========================================
|
|
|
+ if(/*(server_sign == TRUE) &&*/ ((ShmOCPP16Data->OcmfData[gun_index].SendOcmfDataReq == 1)))
|
|
|
+ {
|
|
|
+ sendOcmfByDataTransferRequest(gun_index);
|
|
|
+ ShmOCPP16Data->OcmfData[gun_index].SendOcmfDataReq = 0;
|
|
|
+ }
|
|
|
+
|
|
|
//==========================================
|
|
|
// Charger status report
|
|
|
//==========================================
|
|
@@ -5858,6 +5867,39 @@ int sendUnplugByDataTransferRequest(int gun_index)
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
+int sendOcmfByDataTransferRequest(int gun_index)
|
|
|
+{
|
|
|
+ sprintf((char*)ShmOCPP16Data->DataTransfer[gun_index].VendorId, (char*)ShmSysConfigAndInfo->SysConfig.chargePointVendor);
|
|
|
+ sprintf((char*)ShmOCPP16Data->DataTransfer[gun_index].MessageId, "ID_OCMF");
|
|
|
+ sprintf((char*)ShmOCPP16Data->DataTransfer[gun_index].Data, "{\\\"txId\\\":%d,\\\"dataString\\\":\\\"%s\\\",\\\"publicKey\\\":\\\"%s\\\"}", ShmOCPP16Data->StartTransaction[gun_index].ResponseTransactionId, ShmOCPP16Data->OcmfData[gun_index].DataString, ShmOCPP16Data->OcmfData[gun_index].PublicKey);
|
|
|
+
|
|
|
+ mtrace();
|
|
|
+ char message[3000]={0};
|
|
|
+ char guid[37]={0};
|
|
|
+ char tempdata[65]={0};
|
|
|
+ int result = FAIL;
|
|
|
+
|
|
|
+ random_uuid(guid);
|
|
|
+ sprintf(message,"%d,[%d,\"%s\",\"DataTransfer\",{\"vendorId\":\"%s\",\"messageId\":\"%s\",\"data\":\"%s\"}]",
|
|
|
+ (gun_index+1),
|
|
|
+ MESSAGE_TYPE_CALL,
|
|
|
+ guid,
|
|
|
+ ShmOCPP16Data->DataTransfer[gun_index].VendorId,
|
|
|
+ ShmOCPP16Data->DataTransfer[gun_index].MessageId,
|
|
|
+ ShmOCPP16Data->DataTransfer[gun_index].Data);
|
|
|
+
|
|
|
+ sprintf(tempdata, "DataTransfer,%d", (gun_index + 1));
|
|
|
+ if(hashmap_operation(HASH_OP_ADD, guid, tempdata) == 1)
|
|
|
+ {
|
|
|
+ result = PASS;
|
|
|
+ DEBUG_INFO("DataTransfer mapItem pass\n");
|
|
|
+ }
|
|
|
+
|
|
|
+ queue_operation(QUEUE_OPERATION_ADD, guid, message);
|
|
|
+
|
|
|
+ return result;
|
|
|
+}
|
|
|
+
|
|
|
int sendDiagnosticsStatusNotificationRequest(char *status)
|
|
|
{
|
|
|
mtrace();
|
|
@@ -16346,7 +16388,7 @@ int initialConfigurationTable(void)
|
|
|
char sstr[256]={0};
|
|
|
int c = 0;
|
|
|
char *loc;
|
|
|
- int confVersion = 18;
|
|
|
+ int confVersion = 19;
|
|
|
|
|
|
DEBUG_INFO("initialConfigurationTable...version: %d\n", confVersion);
|
|
|
//start_t = clock();
|
|
@@ -16811,6 +16853,12 @@ int initialConfigurationTable(void)
|
|
|
|
|
|
fprintf(outfile,"{\"key\":\"%s\",\"readonly\":%s,\"value\":\"%s\"}\n","CharingProfileRefreshInterval", "false", ShmOCPP16Data->ConfigurationTable.CoreProfile[CharingProfileRefreshInterval].ItemData);
|
|
|
|
|
|
+ // Ocpp Software certificated version
|
|
|
+ ShmOCPP16Data->ConfigurationTable.CoreProfile[OcppSoftwareVersion].ItemAccessibility = 0;
|
|
|
+ strcpy((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[OcppSoftwareVersion].ItemName, "OcppSoftwareVersion");
|
|
|
+ sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[OcppSoftwareVersion].ItemData, "%s", "V1.00");
|
|
|
+
|
|
|
+ fprintf(outfile,"{\"key\":\"%s\",\"readonly\":%s,\"value\":\"%s\"}\n","OcppSoftwareVersion", "true", ShmOCPP16Data->ConfigurationTable.CoreProfile[OcppSoftwareVersion].ItemData);
|
|
|
|
|
|
//* Local Auth List Management Profile*/
|
|
|
#if 0
|
|
@@ -17311,6 +17359,12 @@ int initialConfigurationTable(void)
|
|
|
sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[CharingProfileRefreshInterval].ItemData, "%s", valuestr);
|
|
|
}
|
|
|
|
|
|
+ if(strcmp(keystr, "OcppSoftwareVersion") == 0)
|
|
|
+ {
|
|
|
+ ShmOCPP16Data->ConfigurationTable.CoreProfile[OcppSoftwareVersion].ItemAccessibility = (strcmp(readonlystr, "true")==0) ? 0 : 1;
|
|
|
+ sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[OcppSoftwareVersion].ItemData, "%s", valuestr);
|
|
|
+ }
|
|
|
+
|
|
|
if(strcmp(keystr, "LocalAuthListEnabled") == 0)
|
|
|
{
|
|
|
ShmOCPP16Data->ConfigurationTable.LocalAuthListManagementProfile[LocalAuthListEnabled].ItemAccessibility = (strcmp(readonlystr, "true")==0) ? 0 : 1;
|
|
@@ -17918,6 +17972,15 @@ void StoreConfigurationTable(void)
|
|
|
|
|
|
fprintf(outfile,"{\"key\":\"%s\",\"readonly\":%s,\"value\":\"%s\"}\n","CharingProfileRefreshInterval", "false", (char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[CharingProfileRefreshInterval].ItemData);
|
|
|
|
|
|
+ // OcppSoftwareVersion
|
|
|
+ /*
|
|
|
+ ShmOCPP16Data->ConfigurationTable.CoreProfile[OcppSoftwareVersion].ItemAccessibility = 1;
|
|
|
+ strcpy((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[OcppSoftwareVersion].ItemName, "OcppSoftwareVersion");
|
|
|
+ strcpy((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[OcppSoftwareVersion].ItemData, "" );
|
|
|
+ */
|
|
|
+
|
|
|
+ fprintf(outfile,"{\"key\":\"%s\",\"readonly\":%s,\"value\":\"%s\"}\n","OcppSoftwareVersion", "true", (char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[OcppSoftwareVersion].ItemData);
|
|
|
+
|
|
|
//* Local Auth List Management Profile*/
|
|
|
//LocalAuthListEnabled
|
|
|
/*
|
|
@@ -19059,6 +19122,24 @@ void getKeyValue(char *keyReq)
|
|
|
strcpy((char *)ShmOCPP16Data->GetConfiguration.ResponseConfigurationKey[GetConfiguration_CharingProfileRefreshInterval].Value, (const char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[CharingProfileRefreshInterval].ItemData );
|
|
|
isKnowKey = TRUE;
|
|
|
}
|
|
|
+
|
|
|
+ if(isEmpty || strcmp(keyReq, "OcppSoftwareVersion") == 0 )
|
|
|
+ {
|
|
|
+ strcpy((char *)ShmOCPP16Data->GetConfiguration.Key[GetConfiguration_OcppSoftwareVersion].Item, "OcppSoftwareVersion");
|
|
|
+ strcpy((char *)ShmOCPP16Data->GetConfiguration.ResponseConfigurationKey[GetConfiguration_OcppSoftwareVersion].Key, "OcppSoftwareVersion");
|
|
|
+
|
|
|
+ if(ShmOCPP16Data->ConfigurationTable.CoreProfile[OcppSoftwareVersion].ItemAccessibility == 1)
|
|
|
+ {
|
|
|
+ strcpy((char *)ShmOCPP16Data->GetConfiguration.ResponseConfigurationKey[GetConfiguration_OcppSoftwareVersion].ReadOnly, "0"/*"FALSE"*/);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ strcpy((char *)ShmOCPP16Data->GetConfiguration.ResponseConfigurationKey[GetConfiguration_OcppSoftwareVersion].ReadOnly, "1"/*"TRUE"*/);
|
|
|
+ }
|
|
|
+
|
|
|
+ strcpy((char *)ShmOCPP16Data->GetConfiguration.ResponseConfigurationKey[GetConfiguration_OcppSoftwareVersion].Value, (const char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[OcppSoftwareVersion].ItemData );
|
|
|
+ isKnowKey = TRUE;
|
|
|
+ }
|
|
|
#if 1
|
|
|
if(isEmpty || strcmp(keyReq, "LocalAuthListEnabled") == 0 )
|
|
|
{
|