|
@@ -41,6 +41,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
|
+
|
|
|
#define PASS 1
|
|
|
#define FAIL -1
|
|
|
|
|
@@ -1611,7 +1613,7 @@ int sendAuthorizeRequest(int gun_index)
|
|
|
memset(&(ShmOCPP16Data->Authorize.ResponseIdTagInfo),0,sizeof(struct StructIdTagInfo));
|
|
|
|
|
|
//Local Authorize
|
|
|
- if ((strcmp((const char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[AllowOfflineTxForUnknownId].ItemName , "TRUE")==0) &&(ShmOCPP16Data->OcppConnStatus == 0))
|
|
|
+ if ((strcmp((const char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[AllowOfflineTxForUnknownId].ItemData , "TRUE")==0) &&(ShmOCPP16Data->OcppConnStatus == 0))
|
|
|
{
|
|
|
DEBUG_INFO("Allow OfflineTx UnknownId Pass !!!!\n");
|
|
|
strcpy((char *)ShmOCPP16Data->Authorize.ResponseIdTagInfo.ExpiryDate, "");
|
|
@@ -8776,17 +8778,20 @@ int handleSendLocalListRequest(char *uuid, char *payload)
|
|
|
}
|
|
|
else if(strcmp(updateTypestr, UpdateTypeStr[Differential]) == 0)
|
|
|
{
|
|
|
+#if 0
|
|
|
if(strcmp(idTagstr, idTagAuthorization) == 0)
|
|
|
{
|
|
|
- OCPP_deleteIdTag(idTagstr);
|
|
|
- OCPP_addLocalList_1(listVersionInt, idTagstr, parentIdTag, expiryDate, idTagstatus); // update
|
|
|
//OCPP_deleteIdTag(idTagstr);
|
|
|
+ OCPP_addLocalList_1(listVersionInt, idTagstr, parentIdTag, expiryDate, idTagstatus); // update
|
|
|
+
|
|
|
}
|
|
|
else if(strcmp(idTagstr, idTagAuthorization) != 0)
|
|
|
{
|
|
|
OCPP_addLocalList_1(listVersionInt, idTagstr, parentIdTag, expiryDate, idTagstatus); // add
|
|
|
|
|
|
}
|
|
|
+#endif
|
|
|
+ OCPP_addLocalList_1(listVersionInt, idTagstr, parentIdTag, expiryDate, idTagstatus); // update or add
|
|
|
|
|
|
}
|
|
|
|
|
@@ -11462,11 +11467,11 @@ int initialConfigurationTable(void)
|
|
|
fprintf(outfile,"{\"key\":\"%s\",\"readonly\":%s,\"value\":\"%s\"}\n","StopTransactionOnEVSideDisconnect", "true", "TRUE");
|
|
|
|
|
|
// StopTransactionOnInvalidId
|
|
|
- ShmOCPP16Data->ConfigurationTable.CoreProfile[StopTransactionOnInvalidId].ItemAccessibility = 1;
|
|
|
+ ShmOCPP16Data->ConfigurationTable.CoreProfile[StopTransactionOnInvalidId].ItemAccessibility = 0; //1;
|
|
|
strcpy((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[StopTransactionOnInvalidId].ItemName, "StopTransactionOnInvalidId");
|
|
|
strcpy((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[StopTransactionOnInvalidId].ItemData, "TRUE" );
|
|
|
|
|
|
- fprintf(outfile,"{\"key\":\"%s\",\"readonly\":%s,\"value\":\"%s\"}\n","StopTransactionOnInvalidId", "false", "TRUE");
|
|
|
+ fprintf(outfile,"{\"key\":\"%s\",\"readonly\":%s,\"value\":\"%s\"}\n","StopTransactionOnInvalidId", "true", "TRUE");
|
|
|
|
|
|
// StopTxnAlignedData
|
|
|
ShmOCPP16Data->ConfigurationTable.CoreProfile[StopTxnAlignedData].ItemAccessibility = 1;
|
|
@@ -14660,7 +14665,7 @@ static int versioncallback(void *data, int argc, char **argv, char **azColName){
|
|
|
//int i;
|
|
|
//printf("%s:\n", (const char*)data);
|
|
|
localversion = argv[5] ? atoi(argv[5]) : 0;
|
|
|
- printf("localversion=%d\n", localversion);
|
|
|
+ //printf("localversion=%d\n", localversion);
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
@@ -14690,9 +14695,10 @@ static int IdTagcallback(void *data, int argc, char **argv, char **azColName){
|
|
|
}
|
|
|
|
|
|
static int deleteIdTagcallback(void *data, int argc, char **argv, char **azColName){
|
|
|
- int i;
|
|
|
+#if 0
|
|
|
+ int i;
|
|
|
//printf("%s:\n", (const char*)data);
|
|
|
-#if 1
|
|
|
+
|
|
|
for(i=0; i<argc; i++){
|
|
|
DEBUG_INFO("%s = %s", azColName[i], argv[i] ? argv[i] : "NULL");
|
|
|
}
|
|
@@ -14733,7 +14739,9 @@ void OCPP_getListVerion()
|
|
|
|
|
|
memset(sql, 0, 100);
|
|
|
memset(zErrMsg, 0, 100);
|
|
|
- strcpy(sql, "select * from ocpp_auth_local order by idx desc");
|
|
|
+ // strcpy(sql, "select * from ocpp_auth_local order by idx desc");
|
|
|
+
|
|
|
+ strcpy(sql, "select * from ocpp_auth_local order by idx");
|
|
|
|
|
|
/* Execute SQL statement */
|
|
|
rc = sqlite3_exec(db, sql, versioncallback, 0, (char **)&zErrMsg);
|
|
@@ -14741,8 +14749,6 @@ void OCPP_getListVerion()
|
|
|
if( rc != SQLITE_OK ){
|
|
|
DEBUG_INFO("SQL error: %s", zErrMsg);
|
|
|
//sqlite3_free(zErrMsg);
|
|
|
- }else{
|
|
|
- DEBUG_INFO("Operation done successfully");
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -14768,11 +14774,8 @@ void OCPP_getIdTag(char idTag[])
|
|
|
if( rc != SQLITE_OK ){
|
|
|
DEBUG_INFO("SQL error: %s", zErrMsg);
|
|
|
//sqlite3_free(zErrMsg);
|
|
|
- }else{
|
|
|
- printf("Operation done successfully");
|
|
|
}
|
|
|
|
|
|
-
|
|
|
//return ver;
|
|
|
}
|
|
|
|
|
@@ -14798,8 +14801,6 @@ void OCPP_get_TableAuthlocalAllData(void)
|
|
|
if( rc != SQLITE_OK ){
|
|
|
DEBUG_INFO("SQL error: %s", zErrMsg);
|
|
|
//sqlite3_free(zErrMsg);
|
|
|
- }else{
|
|
|
- DEBUG_INFO("Operation done successfully");
|
|
|
}
|
|
|
|
|
|
//return ver;
|
|
@@ -14842,12 +14843,22 @@ int OCPP_addLocalList_1(int version, char *idTag, char *parentTage, char *expiry
|
|
|
//zErrMsg = 0;
|
|
|
ret = sqlite3_exec(db, sql, callback, 0, (char **)&zErrMsg);
|
|
|
if( ret != SQLITE_OK ){
|
|
|
- DEBUG_INFO("SQL error: %s\n", zErrMsg);
|
|
|
+ DEBUG_INFO("SQL error: %s\n", zErrMsg);
|
|
|
// free(zErrMsg);
|
|
|
// free(sql);
|
|
|
return isSuccess;
|
|
|
}
|
|
|
|
|
|
+ memset(sql, 0, 300);
|
|
|
+ sprintf(sql, "UPDATE ocpp_auth_local SET version=%d",version);
|
|
|
+ ret = sqlite3_exec(db, sql, NULL, NULL, (char **)&zErrMsg);
|
|
|
+ if( ret != SQLITE_OK ){
|
|
|
+ DEBUG_INFO("SQL error: %s\n", zErrMsg);
|
|
|
+ // free(zErrMsg);
|
|
|
+ // free(sql);
|
|
|
+ return isSuccess;
|
|
|
+ }
|
|
|
+
|
|
|
// DEBUG_INFO("successfully Insert records created\n");
|
|
|
isSuccess = TRUE;
|
|
|
return isSuccess;
|
|
@@ -14870,8 +14881,6 @@ void OCPP_deleteIdTag(char idTag[])
|
|
|
if( rc != SQLITE_OK ){
|
|
|
DEBUG_INFO("SQL error: %s", zErrMsg);
|
|
|
//sqlite3_free(zErrMsg);
|
|
|
- }else{
|
|
|
- DEBUG_INFO("Operation done successfully");
|
|
|
}
|
|
|
}
|
|
|
|