|
@@ -1300,7 +1300,7 @@ void DB_deleteIdTag(char idTag[])
|
|
|
int DB_cleanLocalList()
|
|
|
{
|
|
|
int result = PASS;
|
|
|
- char * sqlcleanLocalList = "delete from ocpp20_auth_cache";
|
|
|
+ char * sqlcleanLocalList = "delete from ocpp20_auth_local";
|
|
|
char *errMsg = 0;
|
|
|
|
|
|
if (sqlite3_exec(db, sqlcleanLocalList, 0, 0, &errMsg) != SQLITE_OK)
|
|
@@ -1315,7 +1315,7 @@ int DB_cleanLocalList()
|
|
|
int DB_cleanLocalCache()
|
|
|
{
|
|
|
int result = PASS;
|
|
|
- char * sqlcleanLocalList = "delete from ocpp20_auth_local";
|
|
|
+ char * sqlcleanLocalList = "delete from ocpp20_auth_cache";
|
|
|
char *errMsg = 0;
|
|
|
|
|
|
if (sqlite3_exec(db, sqlcleanLocalList, 0, 0, &errMsg) != SQLITE_OK)
|
|
@@ -12010,11 +12010,7 @@ int handleClearCacheRequest(char *uuid, char *payload)
|
|
|
system(rmFileCmd);
|
|
|
}
|
|
|
|
|
|
- /*
|
|
|
- * TODO:
|
|
|
- * 1. Clear cache from sqlite db
|
|
|
- */
|
|
|
- if(1)
|
|
|
+ if(DB_cleanLocalCache() != PASS)
|
|
|
{
|
|
|
DEBUG_INFO("open AuthorizationCache file failed\n");
|
|
|
sprintf((char*)ShmOCPP20Data->ClearCache.Response_status, "%s", ClearCacheStatusEnumTypeStr[ClearCacheStatusEnumType_Rejected] );
|
|
@@ -15727,13 +15723,14 @@ int handleSetChargingProfileRequest(char *uuid, char *payload)
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
-int handleSetDisplayMessagesRequest(char *uuid, char *payload)
|
|
|
+int handleSetDisplayMessageRequest(char *uuid, char *payload)
|
|
|
{
|
|
|
mtrace();
|
|
|
int result = FAIL;
|
|
|
json_object *SetDisplayMessage;
|
|
|
|
|
|
DEBUG_INFO("handleSetDisplayMessageRequest...\n");
|
|
|
+
|
|
|
SetDisplayMessage = json_tokener_parse(payload);
|
|
|
if(!is_error(SetDisplayMessage))
|
|
|
{
|
|
@@ -15763,13 +15760,13 @@ int handleSetDisplayMessagesRequest(char *uuid, char *payload)
|
|
|
if(json_object_object_get(json_object_object_get(SetDisplayMessage, "message"), "message") != NULL)
|
|
|
{
|
|
|
if(json_object_object_get(json_object_object_get(json_object_object_get(SetDisplayMessage, "message"), "message"), "format") != NULL)
|
|
|
- sprintf((char*)ShmOCPP20Data->SetDisplayMessage.message.message.format, "%s",json_object_get_string(json_object_object_get(json_object_object_get(json_object_object_get(SetDisplayMessage, "message"), "transactionId"), "format")));
|
|
|
+ sprintf((char*)ShmOCPP20Data->SetDisplayMessage.message.message.format, "%s",json_object_get_string(json_object_object_get(json_object_object_get(json_object_object_get(SetDisplayMessage, "message"), "message"), "format")));
|
|
|
|
|
|
if(json_object_object_get(json_object_object_get(json_object_object_get(SetDisplayMessage, "message"), "message"), "language") != NULL)
|
|
|
- sprintf((char*)ShmOCPP20Data->SetDisplayMessage.message.message.language, "%s",json_object_get_string(json_object_object_get(json_object_object_get(json_object_object_get(SetDisplayMessage, "message"), "transactionId"), "language")));
|
|
|
+ sprintf((char*)ShmOCPP20Data->SetDisplayMessage.message.message.language, "%s",json_object_get_string(json_object_object_get(json_object_object_get(json_object_object_get(SetDisplayMessage, "message"), "message"), "language")));
|
|
|
|
|
|
if(json_object_object_get(json_object_object_get(json_object_object_get(SetDisplayMessage, "message"), "message"), "content") != NULL)
|
|
|
- sprintf((char*)ShmOCPP20Data->SetDisplayMessage.message.message.content, "%s",json_object_get_string(json_object_object_get(json_object_object_get(json_object_object_get(SetDisplayMessage, "message"), "transactionId"), "content")));
|
|
|
+ sprintf((char*)ShmOCPP20Data->SetDisplayMessage.message.message.content, "%s",json_object_get_string(json_object_object_get(json_object_object_get(json_object_object_get(SetDisplayMessage, "message"), "message"), "content")));
|
|
|
}
|
|
|
|
|
|
if(json_object_object_get(json_object_object_get(SetDisplayMessage, "message"), "display") != NULL)
|
|
@@ -15792,10 +15789,8 @@ int handleSetDisplayMessagesRequest(char *uuid, char *payload)
|
|
|
}
|
|
|
}
|
|
|
json_object_put(SetDisplayMessage);
|
|
|
-
|
|
|
strcpy((char*)ShmOCPP20Data->SetDisplayMessage.Response_status, DisplayMessageStatusEnumTypeStr[DisplayMessageStatusEnumType_Accepted]);
|
|
|
sendSetDisplayMessagesConfirmation(uuid);
|
|
|
-
|
|
|
// Announce CSU there is display request come from server
|
|
|
ShmOCPP20Data->MsMsg.bits.SetDisplayMessageReq = ON;
|
|
|
|
|
@@ -16331,6 +16326,8 @@ int handleTriggerMessageRequest(char *uuid, char *payload)
|
|
|
else
|
|
|
connectorIdIsNULL = TRUE;
|
|
|
}
|
|
|
+ else
|
|
|
+ connectorIdIsNULL = TRUE;
|
|
|
}
|
|
|
json_object_put(TriggerMessage);
|
|
|
|