|
@@ -105,10 +105,8 @@ static struct OCPPAuthLocalElemet
|
|
// OCPP HeartBeat Response Not Receive Counts
|
|
// OCPP HeartBeat Response Not Receive Counts
|
|
//============================================
|
|
//============================================
|
|
static int HeartBeatWithNOResponse = 0;
|
|
static int HeartBeatWithNOResponse = 0;
|
|
-static int HeartBeatCountPerHour = 0;
|
|
|
|
|
|
|
|
extern void ChageWebSocketPingInterval(int WebSocketPingInterval);
|
|
extern void ChageWebSocketPingInterval(int WebSocketPingInterval);
|
|
-extern int GetTransactionQueueNum(void);
|
|
|
|
extern struct Charger_Info Charger;
|
|
extern struct Charger_Info Charger;
|
|
extern sqlite3 *db;
|
|
extern sqlite3 *db;
|
|
|
|
|
|
@@ -3318,12 +3316,6 @@ int sendStartTransactionRequest(int gun_index)
|
|
strcpy(queuedata, message);
|
|
strcpy(queuedata, message);
|
|
queue_operation(QUEUE_OPERATION_ADD, guid, queuedata );//addq(guid, queuedata); ---> remove temporally
|
|
queue_operation(QUEUE_OPERATION_ADD, guid, queuedata );//addq(guid, queuedata); ---> remove temporally
|
|
|
|
|
|
- /*
|
|
|
|
- if(GetTransactionQueueNum() == 1)
|
|
|
|
- {
|
|
|
|
- LWS_Send(message + 2);
|
|
|
|
- }*/
|
|
|
|
-
|
|
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -4585,11 +4577,6 @@ int sendStopTransactionRequest(int gun_index)
|
|
}
|
|
}
|
|
#endif
|
|
#endif
|
|
queue_operation(QUEUE_OPERATION_ADD, guid, queuedata );//addq(guid, queuedata); ---> remove temporally
|
|
queue_operation(QUEUE_OPERATION_ADD, guid, queuedata );//addq(guid, queuedata); ---> remove temporally
|
|
-/*
|
|
|
|
- if(GetTransactionQueueNum() == 1)
|
|
|
|
- {
|
|
|
|
- LWS_Send(queuedata+2);
|
|
|
|
- }*/
|
|
|
|
|
|
|
|
//----------------------------replace queue StopTransaction TransactionId ---------------------------//
|
|
//----------------------------replace queue StopTransaction TransactionId ---------------------------//
|
|
//int gettransactionId = GetTransactionId(gun_index+1, ShmOCPP16Data->StopTransaction[gun_index].IdTag);
|
|
//int gettransactionId = GetTransactionId(gun_index+1, ShmOCPP16Data->StopTransaction[gun_index].IdTag);
|
|
@@ -5481,12 +5468,6 @@ int sendMeterValuesRequest(int gun_index, ReadingContext dataType)
|
|
queue_operation(QUEUE_OPERATION_ADD, guid, queuedata );//addq(guid, queuedata); ---> remove temporally
|
|
queue_operation(QUEUE_OPERATION_ADD, guid, queuedata );//addq(guid, queuedata); ---> remove temporally
|
|
else
|
|
else
|
|
LWS_Send(queuedata +2);
|
|
LWS_Send(queuedata +2);
|
|
-/*
|
|
|
|
- if(GetTransactionQueueNum() == 1)
|
|
|
|
- {
|
|
|
|
- LWS_Send(queuedata +2);
|
|
|
|
-
|
|
|
|
- }*/
|
|
|
|
|
|
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
@@ -7316,6 +7297,68 @@ int handleDataTransferRequest(char *uuid, char *payload)
|
|
|
|
|
|
sprintf(message,"[%d,\"%s\",%s]",MESSAGE_TYPE_CALLRESULT, uuid, json_object_to_json_string(response));
|
|
sprintf(message,"[%d,\"%s\",%s]",MESSAGE_TYPE_CALLRESULT, uuid, json_object_to_json_string(response));
|
|
}
|
|
}
|
|
|
|
+ else if(strstr(tempmessageId, "SetUserPrice") != NULL)
|
|
|
|
+ {
|
|
|
|
+ json_object *data;
|
|
|
|
+ data = json_tokener_parse(tempdata);
|
|
|
|
+ if(!is_error(data))
|
|
|
|
+ {
|
|
|
|
+ if(json_object_object_get(data, "idToken") != NULL)
|
|
|
|
+ DEBUG_INFO("idToken: %s\n", json_object_get_string(json_object_object_get(data, "idToken")));
|
|
|
|
+
|
|
|
|
+ if(json_object_object_get(data, "price") != NULL)
|
|
|
|
+ DEBUG_INFO("price: %s\n", json_object_get_string(json_object_object_get(data, "price")));
|
|
|
|
+
|
|
|
|
+ json_object_object_add(response, "status", json_object_new_string("Accepted"));
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ json_object_object_add(response, "status", json_object_new_string("Rejected"));
|
|
|
|
+ json_object_object_add(response, "data", json_object_new_string("Configuration content something wrong."));
|
|
|
|
+ }
|
|
|
|
+ json_object_put(data);
|
|
|
|
+ }
|
|
|
|
+ else if(strstr(tempmessageId, "RunningCost") != NULL)
|
|
|
|
+ {
|
|
|
|
+ json_object *data;
|
|
|
|
+ data = json_tokener_parse(tempdata);
|
|
|
|
+ if(!is_error(data))
|
|
|
|
+ {
|
|
|
|
+ if(json_object_object_get(data, "txId") != NULL)
|
|
|
|
+
|
|
|
|
+ if(json_object_object_get(data, "description") != NULL)
|
|
|
|
+ DEBUG_INFO("description: %s\n", json_object_get_string(json_object_object_get(data, "description")));
|
|
|
|
+
|
|
|
|
+ json_object_object_add(response, "status", json_object_new_string("Accepted"));
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ json_object_object_add(response, "status", json_object_new_string("Rejected"));
|
|
|
|
+ json_object_object_add(response, "data", json_object_new_string("Configuration content something wrong."));
|
|
|
|
+ }
|
|
|
|
+ json_object_put(data);
|
|
|
|
+ }
|
|
|
|
+ else if(strstr(tempmessageId, "FinalCost") != NULL)
|
|
|
|
+ {
|
|
|
|
+ json_object *data;
|
|
|
|
+ data = json_tokener_parse(tempdata);
|
|
|
|
+ if(!is_error(data))
|
|
|
|
+ {
|
|
|
|
+ if(json_object_object_get(data, "txId") != NULL)
|
|
|
|
+ DEBUG_INFO("transaction id: %d\n", json_object_get_int(json_object_object_get(data, "txId")));
|
|
|
|
+
|
|
|
|
+ if(json_object_object_get(data, "description") != NULL)
|
|
|
|
+ DEBUG_INFO("description: %s\n", json_object_get_string(json_object_object_get(data, "description")));
|
|
|
|
+
|
|
|
|
+ json_object_object_add(response, "status", json_object_new_string("Accepted"));
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ json_object_object_add(response, "status", json_object_new_string("Rejected"));
|
|
|
|
+ json_object_object_add(response, "data", json_object_new_string("Configuration content something wrong."));
|
|
|
|
+ }
|
|
|
|
+ json_object_put(data);
|
|
|
|
+ }
|
|
else
|
|
else
|
|
{
|
|
{
|
|
// Can not find valid message id
|
|
// Can not find valid message id
|
|
@@ -10856,40 +10899,11 @@ void handleHeartbeatResponse(char *payload, int gun_index)
|
|
memset(timebuf, 0, ARRAY_SIZE(timebuf));
|
|
memset(timebuf, 0, ARRAY_SIZE(timebuf));
|
|
sprintf(timebuf,"date -s '%s'",buf);
|
|
sprintf(timebuf,"date -s '%s'",buf);
|
|
system(timebuf);
|
|
system(timebuf);
|
|
|
|
+
|
|
//==============================================
|
|
//==============================================
|
|
// RTC sync
|
|
// RTC sync
|
|
//==============================================
|
|
//==============================================
|
|
system("/sbin/hwclock -w --systohc");
|
|
system("/sbin/hwclock -w --systohc");
|
|
-
|
|
|
|
- //===============================================
|
|
|
|
- //Print Out HeartBeat log
|
|
|
|
- //===============================================
|
|
|
|
- {
|
|
|
|
- double diff_t;
|
|
|
|
- struct tm tp,tp1;
|
|
|
|
-
|
|
|
|
- // BootNotification Receive Time
|
|
|
|
-
|
|
|
|
- strptime((const char *)ShmOCPP16Data->BootNotification.ResponseCurrentTime, "%Y-%m-%dT%H:%M:%S", &tp);
|
|
|
|
- tp.tm_isdst = -1;
|
|
|
|
- time_t BootNotificationReceiveTime = mktime(&tp);
|
|
|
|
-
|
|
|
|
- //HeartBeat Receive Time
|
|
|
|
- strptime((const char *)ShmOCPP16Data->Heartbeat.ResponseCurrentTime, "%Y-%m-%dT%H:%M:%S", &tp1);
|
|
|
|
- tp1.tm_isdst = -1;
|
|
|
|
- time_t HeartBeatReceiveTime = mktime(&tp1);
|
|
|
|
-
|
|
|
|
- diff_t = difftime(HeartBeatReceiveTime, BootNotificationReceiveTime);
|
|
|
|
-
|
|
|
|
- DEBUG_INFO("handleHeartbeatResponse differnt time=%f..\n",diff_t);
|
|
|
|
-
|
|
|
|
- if(((int)diff_t / 3600) > HeartBeatCountPerHour)
|
|
|
|
- {
|
|
|
|
- HeartBeatCountPerHour = (int)diff_t / 3600;
|
|
|
|
- DEBUG_INFO("handleHeartbeatResponse ...\n");
|
|
|
|
- DEBUG_INFO("After 1 hour, It will print out Heartbeat.\n");
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
|
|
|
|
void handleMeterValuesResponse(char *payload, int gun_index)
|
|
void handleMeterValuesResponse(char *payload, int gun_index)
|
|
@@ -11347,6 +11361,27 @@ int initialConfigurationTable(void)
|
|
|
|
|
|
fprintf(outfile,"{\"key\":\"%s\",\"readonly\":%s,\"value\":\"%s\"}\n","SecurityProfile", "false", ShmOCPP16Data->ConfigurationTable.CoreProfile[SecurityProfile].ItemData);
|
|
fprintf(outfile,"{\"key\":\"%s\",\"readonly\":%s,\"value\":\"%s\"}\n","SecurityProfile", "false", ShmOCPP16Data->ConfigurationTable.CoreProfile[SecurityProfile].ItemData);
|
|
|
|
|
|
|
|
+ // DefaultPrice
|
|
|
|
+ ShmOCPP16Data->ConfigurationTable.CoreProfile[DefaultPrice].ItemAccessibility = 1;
|
|
|
|
+ strcpy((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[DefaultPrice].ItemName, "DefaultPrice");
|
|
|
|
+ strcpy((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[DefaultPrice].ItemData, "" );
|
|
|
|
+
|
|
|
|
+ fprintf(outfile,"{\"key\":\"%s\",\"readonly\":%s,\"value\":\"%s\"}\n","DefaultPrice", "false", ShmOCPP16Data->ConfigurationTable.CoreProfile[DefaultPrice].ItemData);
|
|
|
|
+
|
|
|
|
+ // CustomDisplayCostAndPrice
|
|
|
|
+ ShmOCPP16Data->ConfigurationTable.CoreProfile[CustomDisplayCostAndPrice].ItemAccessibility = 1;
|
|
|
|
+ strcpy((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[CustomDisplayCostAndPrice].ItemName, "CustomDisplayCostAndPrice");
|
|
|
|
+ strcpy((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[CustomDisplayCostAndPrice].ItemData, "FALSE" );
|
|
|
|
+
|
|
|
|
+ fprintf(outfile,"{\"key\":\"%s\",\"readonly\":%s,\"value\":\"%s\"}\n","CustomDisplayCostAndPrice", "false", ShmOCPP16Data->ConfigurationTable.CoreProfile[CustomDisplayCostAndPrice].ItemData);
|
|
|
|
+
|
|
|
|
+ // CustomIdleFeeAfterStop
|
|
|
|
+ ShmOCPP16Data->ConfigurationTable.CoreProfile[CustomIdleFeeAfterStop].ItemAccessibility = 1;
|
|
|
|
+ strcpy((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[CustomIdleFeeAfterStop].ItemName, "CustomIdleFeeAfterStop");
|
|
|
|
+ strcpy((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[CustomIdleFeeAfterStop].ItemData, "FALSE" );
|
|
|
|
+
|
|
|
|
+ fprintf(outfile,"{\"key\":\"%s\",\"readonly\":%s,\"value\":\"%s\"}\n","CustomIdleFeeAfterStop", "false", ShmOCPP16Data->ConfigurationTable.CoreProfile[CustomIdleFeeAfterStop].ItemData);
|
|
|
|
+
|
|
//* Local Auth List Management Profile*/
|
|
//* Local Auth List Management Profile*/
|
|
#if 0
|
|
#if 0
|
|
//For OCTT Test Case
|
|
//For OCTT Test Case
|
|
@@ -11716,6 +11751,24 @@ int initialConfigurationTable(void)
|
|
sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[SecurityProfile].ItemData, "%d", atoi(valuestr) );
|
|
sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[SecurityProfile].ItemData, "%d", atoi(valuestr) );
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if(strcmp(keystr, "DefaultPrice") == 0)
|
|
|
|
+ {
|
|
|
|
+ ShmOCPP16Data->ConfigurationTable.CoreProfile[DefaultPrice].ItemAccessibility = (strcmp(readonlystr, "true")==0) ? 0 : 1;
|
|
|
|
+ sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[DefaultPrice].ItemData, "%s", valuestr);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(strcmp(keystr, "CustomDisplayCostAndPrice") == 0)
|
|
|
|
+ {
|
|
|
|
+ ShmOCPP16Data->ConfigurationTable.CoreProfile[CustomDisplayCostAndPrice].ItemAccessibility = (strcmp(readonlystr, "true")==0) ? 0 : 1;
|
|
|
|
+ sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[CustomDisplayCostAndPrice].ItemData, "%s", valuestr);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(strcmp(keystr, "CustomIdleFeeAfterStop") == 0)
|
|
|
|
+ {
|
|
|
|
+ ShmOCPP16Data->ConfigurationTable.CoreProfile[CustomIdleFeeAfterStop].ItemAccessibility = (strcmp(readonlystr, "true")==0) ? 0 : 1;
|
|
|
|
+ sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[CustomIdleFeeAfterStop].ItemData, "%s", valuestr);
|
|
|
|
+ }
|
|
|
|
+
|
|
if(strcmp(keystr, "LocalAuthListEnabled") == 0)
|
|
if(strcmp(keystr, "LocalAuthListEnabled") == 0)
|
|
{
|
|
{
|
|
ShmOCPP16Data->ConfigurationTable.LocalAuthListManagementProfile[LocalAuthListEnabled].ItemAccessibility = (strcmp(readonlystr, "true")==0) ? 0 : 1;
|
|
ShmOCPP16Data->ConfigurationTable.LocalAuthListManagementProfile[LocalAuthListEnabled].ItemAccessibility = (strcmp(readonlystr, "true")==0) ? 0 : 1;
|
|
@@ -12135,6 +12188,33 @@ void StoreConfigurationTable(void)
|
|
|
|
|
|
fprintf(outfile,"{\"key\":\"%s\",\"readonly\":%s,\"value\":\"%s\"}\n","SecurityProfile", "false", (char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[SecurityProfile].ItemData);
|
|
fprintf(outfile,"{\"key\":\"%s\",\"readonly\":%s,\"value\":\"%s\"}\n","SecurityProfile", "false", (char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[SecurityProfile].ItemData);
|
|
|
|
|
|
|
|
+ // DefaultPrice
|
|
|
|
+ /*
|
|
|
|
+ ShmOCPP16Data->ConfigurationTable.CoreProfile[DefaultPrice].ItemAccessibility = 1;
|
|
|
|
+ strcpy((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[DefaultPrice].ItemName, "DefaultPrice");
|
|
|
|
+ strcpy((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[DefaultPrice].ItemData, "" );
|
|
|
|
+ */
|
|
|
|
+
|
|
|
|
+ fprintf(outfile,"{\"key\":\"%s\",\"readonly\":%s,\"value\":\"%s\"}\n","DefaultPrice", "false", (char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[DefaultPrice].ItemData);
|
|
|
|
+
|
|
|
|
+ // CustomDisplayCostAndPrice
|
|
|
|
+ /*
|
|
|
|
+ ShmOCPP16Data->ConfigurationTable.CoreProfile[CustomDisplayCostAndPrice].ItemAccessibility = 1;
|
|
|
|
+ strcpy((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[CustomDisplayCostAndPrice].ItemName, "CustomDisplayCostAndPrice");
|
|
|
|
+ strcpy((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[CustomDisplayCostAndPrice].ItemData, "FALSE" );
|
|
|
|
+ */
|
|
|
|
+
|
|
|
|
+ fprintf(outfile,"{\"key\":\"%s\",\"readonly\":%s,\"value\":\"%s\"}\n","CustomDisplayCostAndPrice", "false", (char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[CustomDisplayCostAndPrice].ItemData);
|
|
|
|
+
|
|
|
|
+ // CustomIdleFeeAfterStop
|
|
|
|
+ /*
|
|
|
|
+ ShmOCPP16Data->ConfigurationTable.CoreProfile[CustomIdleFeeAfterStop].ItemAccessibility = 1;
|
|
|
|
+ strcpy((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[CustomIdleFeeAfterStop].ItemName, "CustomIdleFeeAfterStop");
|
|
|
|
+ strcpy((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[CustomIdleFeeAfterStop].ItemData, "FALSE" );
|
|
|
|
+ */
|
|
|
|
+
|
|
|
|
+ fprintf(outfile,"{\"key\":\"%s\",\"readonly\":%s,\"value\":\"%s\"}\n","CustomIdleFeeAfterStop", "false", (char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[CustomIdleFeeAfterStop].ItemData);
|
|
|
|
+
|
|
//* Local Auth List Management Profile*/
|
|
//* Local Auth List Management Profile*/
|
|
//LocalAuthListEnabled
|
|
//LocalAuthListEnabled
|
|
/*
|
|
/*
|
|
@@ -12905,6 +12985,61 @@ void getKeyValue(char *keyReq)
|
|
strcpy((char *)ShmOCPP16Data->GetConfiguration.ResponseConfigurationKey[GetConfiguration_SecurityProfile].Value, (const char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[SecurityProfile].ItemData );
|
|
strcpy((char *)ShmOCPP16Data->GetConfiguration.ResponseConfigurationKey[GetConfiguration_SecurityProfile].Value, (const char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[SecurityProfile].ItemData );
|
|
isKnowKey = TRUE;
|
|
isKnowKey = TRUE;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ if(isEmpty || strcmp(keyReq, "DefaultPrice") == 0 )
|
|
|
|
+ {
|
|
|
|
+ strcpy((char *)ShmOCPP16Data->GetConfiguration.Key[GetConfiguration_DefaultPrice].Item, "DefaultPrice");
|
|
|
|
+ strcpy((char *)ShmOCPP16Data->GetConfiguration.ResponseConfigurationKey[GetConfiguration_DefaultPrice].Key, "DefaultPrice");
|
|
|
|
+
|
|
|
|
+ if(ShmOCPP16Data->ConfigurationTable.CoreProfile[DefaultPrice].ItemAccessibility == 1)
|
|
|
|
+ {
|
|
|
|
+ strcpy((char *)ShmOCPP16Data->GetConfiguration.ResponseConfigurationKey[GetConfiguration_DefaultPrice].ReadOnly, "0"/*"FALSE"*/);
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ strcpy((char *)ShmOCPP16Data->GetConfiguration.ResponseConfigurationKey[GetConfiguration_DefaultPrice].ReadOnly, "1"/*"TRUE"*/);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ strcpy((char *)ShmOCPP16Data->GetConfiguration.ResponseConfigurationKey[GetConfiguration_DefaultPrice].Value, (const char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[DefaultPrice].ItemData );
|
|
|
|
+ isKnowKey = TRUE;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(isEmpty || strcmp(keyReq, "CustomDisplayCostAndPrice") == 0 )
|
|
|
|
+ {
|
|
|
|
+ strcpy((char *)ShmOCPP16Data->GetConfiguration.Key[GetConfiguration_CustomDisplayCostAndPrice].Item, "CustomDisplayCostAndPrice");
|
|
|
|
+ strcpy((char *)ShmOCPP16Data->GetConfiguration.ResponseConfigurationKey[GetConfiguration_CustomDisplayCostAndPrice].Key, "CustomDisplayCostAndPrice");
|
|
|
|
+
|
|
|
|
+ if(ShmOCPP16Data->ConfigurationTable.CoreProfile[CustomDisplayCostAndPrice].ItemAccessibility == 1)
|
|
|
|
+ {
|
|
|
|
+ strcpy((char *)ShmOCPP16Data->GetConfiguration.ResponseConfigurationKey[GetConfiguration_CustomDisplayCostAndPrice].ReadOnly, "0"/*"FALSE"*/);
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ strcpy((char *)ShmOCPP16Data->GetConfiguration.ResponseConfigurationKey[GetConfiguration_CustomDisplayCostAndPrice].ReadOnly, "1"/*"TRUE"*/);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ strcpy((char *)ShmOCPP16Data->GetConfiguration.ResponseConfigurationKey[GetConfiguration_CustomDisplayCostAndPrice].Value, (const char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[CustomDisplayCostAndPrice].ItemData );
|
|
|
|
+ isKnowKey = TRUE;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(isEmpty || strcmp(keyReq, "CustomIdleFeeAfterStop") == 0 )
|
|
|
|
+ {
|
|
|
|
+ strcpy((char *)ShmOCPP16Data->GetConfiguration.Key[GetConfiguration_CustomIdleFeeAfterStop].Item, "CustomIdleFeeAfterStop");
|
|
|
|
+ strcpy((char *)ShmOCPP16Data->GetConfiguration.ResponseConfigurationKey[GetConfiguration_CustomIdleFeeAfterStop].Key, "CustomIdleFeeAfterStop");
|
|
|
|
+
|
|
|
|
+ if(ShmOCPP16Data->ConfigurationTable.CoreProfile[CustomIdleFeeAfterStop].ItemAccessibility == 1)
|
|
|
|
+ {
|
|
|
|
+ strcpy((char *)ShmOCPP16Data->GetConfiguration.ResponseConfigurationKey[GetConfiguration_CustomIdleFeeAfterStop].ReadOnly, "0"/*"FALSE"*/);
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ strcpy((char *)ShmOCPP16Data->GetConfiguration.ResponseConfigurationKey[GetConfiguration_CustomIdleFeeAfterStop].ReadOnly, "1"/*"TRUE"*/);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ strcpy((char *)ShmOCPP16Data->GetConfiguration.ResponseConfigurationKey[GetConfiguration_CustomIdleFeeAfterStop].Value, (const char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[CustomIdleFeeAfterStop].ItemData );
|
|
|
|
+ isKnowKey = TRUE;
|
|
|
|
+ }
|
|
|
|
+
|
|
#if 1
|
|
#if 1
|
|
if(isEmpty || strcmp(keyReq, "LocalAuthListEnabled") == 0 )
|
|
if(isEmpty || strcmp(keyReq, "LocalAuthListEnabled") == 0 )
|
|
{
|
|
{
|
|
@@ -13936,6 +14071,59 @@ int setKeyValue(char *key, char *value)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if(strcmp(key, "DefaultPrice") == 0)
|
|
|
|
+ {
|
|
|
|
+ if((ShmOCPP16Data->ConfigurationTable.CoreProfile[DefaultPrice].ItemAccessibility == 1))
|
|
|
|
+ {
|
|
|
|
+ strcpy(str, (const char*)value);
|
|
|
|
+ sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[DefaultPrice].ItemData, "%s", str);
|
|
|
|
+ isSuccess = ConfigurationStatus_Accepted;
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ isSuccess = ConfigurationStatus_Rejected;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(strcmp(key, "CustomDisplayCostAndPrice") == 0)
|
|
|
|
+ {
|
|
|
|
+ if(ShmOCPP16Data->ConfigurationTable.CoreProfile[CustomDisplayCostAndPrice].ItemAccessibility == 1)
|
|
|
|
+ {
|
|
|
|
+ strcpy(str, (const char*)value);
|
|
|
|
+ for(int i = 0; str[i]; i++)
|
|
|
|
+ {
|
|
|
|
+ str[i] = tolower(str[i]);
|
|
|
|
+ }
|
|
|
|
+ //Charger.QueueOffLineStartTransactionMessage = (value.toLowerCase().equals("true")?true:false);
|
|
|
|
+ sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[CustomDisplayCostAndPrice].ItemData, "%s", (strcmp(str, "true")==0) ?"TRUE":"FALSE" );
|
|
|
|
+ isSuccess = ConfigurationStatus_Accepted;
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ isSuccess = ConfigurationStatus_Rejected;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(strcmp(key, "CustomIdleFeeAfterStop") == 0)
|
|
|
|
+ {
|
|
|
|
+ if(ShmOCPP16Data->ConfigurationTable.CoreProfile[CustomIdleFeeAfterStop].ItemAccessibility == 1)
|
|
|
|
+ {
|
|
|
|
+ strcpy(str, (const char*)value);
|
|
|
|
+ for(int i = 0; str[i]; i++)
|
|
|
|
+ {
|
|
|
|
+ str[i] = tolower(str[i]);
|
|
|
|
+ }
|
|
|
|
+ //Charger.QueueOffLineStartTransactionMessage = (value.toLowerCase().equals("true")?true:false);
|
|
|
|
+ sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[CustomIdleFeeAfterStop].ItemData, "%s", (strcmp(str, "true")==0) ?"TRUE":"FALSE" );
|
|
|
|
+ isSuccess = ConfigurationStatus_Accepted;
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ isSuccess = ConfigurationStatus_Rejected;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
#if 0
|
|
#if 0
|
|
//For OCPP Test Case
|
|
//For OCPP Test Case
|
|
if(strcmp(key, "LocalAuthorizationListEnabled") == 0)
|
|
if(strcmp(key, "LocalAuthorizationListEnabled") == 0)
|
|
@@ -15920,7 +16108,6 @@ void InitialSystemValue(void)
|
|
|
|
|
|
//Hear Beat
|
|
//Hear Beat
|
|
HeartBeatWithNOResponse = 0;
|
|
HeartBeatWithNOResponse = 0;
|
|
- HeartBeatCountPerHour = 0;
|
|
|
|
HeartBeatWaitTime = atoi((char*)ShmOCPP16Data->ConfigurationTable.CoreProfile[HeartbeatInterval].ItemData);;
|
|
HeartBeatWaitTime = atoi((char*)ShmOCPP16Data->ConfigurationTable.CoreProfile[HeartbeatInterval].ItemData);;
|
|
FirstHeartBeat = 0;
|
|
FirstHeartBeat = 0;
|
|
|
|
|