|
@@ -812,7 +812,7 @@ static int localversion=0;
|
|
//===============================
|
|
//===============================
|
|
// Variable Version
|
|
// Variable Version
|
|
//===============================
|
|
//===============================
|
|
-static int variableVersion=9;
|
|
|
|
|
|
+static int variableVersion=10;
|
|
|
|
|
|
//===============================
|
|
//===============================
|
|
// OCPP sign variable
|
|
// OCPP sign variable
|
|
@@ -2807,6 +2807,14 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_AuthorizeTimeout].variableAttribute[0].value, "15");
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_AuthorizeTimeout].variableAttribute[0].value, "15");
|
|
DB_variableSaveToDb(&ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_AuthorizeTimeout]);
|
|
DB_variableSaveToDb(&ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_AuthorizeTimeout]);
|
|
|
|
|
|
|
|
+ sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_EnableAcCcs].component.name, "OCPPCommCtrlr");
|
|
|
|
+ sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_EnableAcCcs].variable.name, "EnableAcCcs");
|
|
|
|
+ sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_EnableAcCcs].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_boolean]);
|
|
|
|
+ sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_EnableAcCcs].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Actual]);
|
|
|
|
+ sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_EnableAcCcs].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadWrite]);
|
|
|
|
+ sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_EnableAcCcs].variableAttribute[0].value, "false");
|
|
|
|
+ DB_variableSaveToDb(&ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_EnableAcCcs]);
|
|
|
|
+
|
|
/* ReservationCtrlr Required item */
|
|
/* ReservationCtrlr Required item */
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ReservationCtrlr_Enabled].component.name, "ReservationCtrlr");
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ReservationCtrlr_Enabled].component.name, "ReservationCtrlr");
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ReservationCtrlr_Enabled].variable.name, "Enabled");
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ReservationCtrlr_Enabled].variable.name, "Enabled");
|
|
@@ -3514,6 +3522,9 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_AuthorizeTimeout].component.name, "OCPPCommCtrlr");
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_AuthorizeTimeout].component.name, "OCPPCommCtrlr");
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_AuthorizeTimeout].variable.name, "AuthorizeTimeout");
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_AuthorizeTimeout].variable.name, "AuthorizeTimeout");
|
|
|
|
|
|
|
|
+ sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_EnableAcCcs].component.name, "OCPPCommCtrlr");
|
|
|
|
+ sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_EnableAcCcs].variable.name, "EnableAcCcs");
|
|
|
|
+
|
|
/* ReservationCtrlr Required item */
|
|
/* ReservationCtrlr Required item */
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ReservationCtrlr_Enabled].component.name, "ReservationCtrlr");
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ReservationCtrlr_Enabled].component.name, "ReservationCtrlr");
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ReservationCtrlr_Enabled].variable.name, "Enabled");
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ReservationCtrlr_Enabled].variable.name, "Enabled");
|
|
@@ -19330,6 +19341,7 @@ int handleSetVariablesRequest(char *uuid, char *payload)
|
|
(strlen((char*)ShmOCPP20Data->SetVariables.setVariableData[idx].variable.instance)>0?(strstr((char*)ShmOCPP20Data->ControllerComponentVariable[idx_var].variable.instance, (char*)ShmOCPP20Data->SetVariables.setVariableData[idx].variable.instance) != NULL):TRUE))
|
|
(strlen((char*)ShmOCPP20Data->SetVariables.setVariableData[idx].variable.instance)>0?(strstr((char*)ShmOCPP20Data->ControllerComponentVariable[idx_var].variable.instance, (char*)ShmOCPP20Data->SetVariables.setVariableData[idx].variable.instance) != NULL):TRUE))
|
|
{
|
|
{
|
|
isUnknownComponent = FALSE;
|
|
isUnknownComponent = FALSE;
|
|
|
|
+ strcpy((char*)ShmOCPP20Data->SetVariables.Response_setVariableResult[idx].attributeStatus, SetVariableStatusEnumTypeStr[SetVariableStatusEnumType_Accepted]);
|
|
//DEBUG_INFO("Checking variable...[%s][%s], dataType: %s\n",ShmOCPP20Data->ControllerComponentVariable[idx_var].component.name, ShmOCPP20Data->ControllerComponentVariable[idx_var].variable.name, ShmOCPP20Data->ControllerComponentVariable[idx_var].variableCharacteristics.dataType);
|
|
//DEBUG_INFO("Checking variable...[%s][%s], dataType: %s\n",ShmOCPP20Data->ControllerComponentVariable[idx_var].component.name, ShmOCPP20Data->ControllerComponentVariable[idx_var].variable.name, ShmOCPP20Data->ControllerComponentVariable[idx_var].variableCharacteristics.dataType);
|
|
|
|
|
|
if(strcmp((char*)ShmOCPP20Data->ControllerComponentVariable[idx_var].variableCharacteristics.dataType,DataEnumTypeStr[DataEnumType_decimal]) == 0)
|
|
if(strcmp((char*)ShmOCPP20Data->ControllerComponentVariable[idx_var].variableCharacteristics.dataType,DataEnumTypeStr[DataEnumType_decimal]) == 0)
|
|
@@ -19534,6 +19546,24 @@ int handleSetVariablesRequest(char *uuid, char *payload)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if((strstr((char*)ShmOCPP20Data->SetVariables.setVariableData[idx].component.name, "OCPPCommCtrlr") != NULL) && (strstr((char*)ShmOCPP20Data->SetVariables.setVariableData[idx].variable.name, "EnableAcCcs") != NULL))
|
|
|
|
+ {
|
|
|
|
+ char tmp[ARRAY_SIZE(ShmOCPP20Data->SetVariables.setVariableData[idx].attributeValue)];
|
|
|
|
+
|
|
|
|
+ for(int tmpidx=0;tmpidx<ARRAY_SIZE(tmp);tmpidx++)
|
|
|
|
+ tmp[tmpidx] = tolower(ShmOCPP20Data->SetVariables.setVariableData[idx].attributeValue[tmpidx]);
|
|
|
|
+ if((strstr((char*)tmp, "true") != NULL) || (strstr((char*)tmp, "false") != NULL))
|
|
|
|
+ {
|
|
|
|
+ strcpy((char*)ShmOCPP20Data->SetVariables.setVariableData[idx].attributeValue,(strstr((char*)tmp, "true") != NULL)? "true" : "false");
|
|
|
|
+ strcpy((char*)ShmOCPP20Data->SetVariables.Response_setVariableResult[idx].attributeStatus, SetVariableStatusEnumTypeStr[SetVariableStatusEnumType_Accepted]);
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ strcpy((char*)ShmOCPP20Data->SetVariables.Response_setVariableResult[idx].attributeStatus, SetVariableStatusEnumTypeStr[SetVariableStatusEnumType_Rejected]);
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
if((strstr((char*)ShmOCPP20Data->SetVariables.setVariableData[idx].component.name, "SecurityCtrlr") != NULL) &&
|
|
if((strstr((char*)ShmOCPP20Data->SetVariables.setVariableData[idx].component.name, "SecurityCtrlr") != NULL) &&
|
|
((strstr((char*)ShmOCPP20Data->SetVariables.setVariableData[idx].variable.name, "SecurityProfile") != NULL) || (strstr((char*)ShmOCPP20Data->SetVariables.setVariableData[idx].variable.name, "BasicAuthPassword") != NULL)))
|
|
((strstr((char*)ShmOCPP20Data->SetVariables.setVariableData[idx].variable.name, "SecurityProfile") != NULL) || (strstr((char*)ShmOCPP20Data->SetVariables.setVariableData[idx].variable.name, "BasicAuthPassword") != NULL)))
|
|
{
|
|
{
|
|
@@ -19552,6 +19582,42 @@ int handleSetVariablesRequest(char *uuid, char *payload)
|
|
strcpy((char*)ShmOCPP20Data->SetVariables.Response_setVariableResult[idx].attributeStatus, SetVariableStatusEnumTypeStr[SetVariableStatusEnumType_Accepted]);
|
|
strcpy((char*)ShmOCPP20Data->SetVariables.Response_setVariableResult[idx].attributeStatus, SetVariableStatusEnumTypeStr[SetVariableStatusEnumType_Accepted]);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if((strstr((char*)ShmOCPP20Data->SetVariables.setVariableData[idx].component.name, "AlignedDataCtrlr") != NULL) && (strstr((char*)ShmOCPP20Data->SetVariables.setVariableData[idx].variable.name, "SendDuringIdle") != NULL))
|
|
|
|
+ {
|
|
|
|
+ char tmp[ARRAY_SIZE(ShmOCPP20Data->SetVariables.setVariableData[idx].attributeValue)];
|
|
|
|
+
|
|
|
|
+ for(int tmpidx=0;tmpidx<ARRAY_SIZE(tmp);tmpidx++)
|
|
|
|
+ tmp[tmpidx] = tolower(ShmOCPP20Data->SetVariables.setVariableData[idx].attributeValue[tmpidx]);
|
|
|
|
+ if((strstr((char*)tmp, "true") != NULL) || (strstr((char*)tmp, "false") != NULL))
|
|
|
|
+ {
|
|
|
|
+ strcpy((char*)ShmOCPP20Data->SetVariables.setVariableData[idx].attributeValue,(strstr((char*)tmp, "true") != NULL)? "true" : "false");
|
|
|
|
+ strcpy((char*)ShmOCPP20Data->SetVariables.Response_setVariableResult[idx].attributeStatus, SetVariableStatusEnumTypeStr[SetVariableStatusEnumType_Accepted]);
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ strcpy((char*)ShmOCPP20Data->SetVariables.Response_setVariableResult[idx].attributeStatus, SetVariableStatusEnumTypeStr[SetVariableStatusEnumType_Rejected]);
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if((strstr((char*)ShmOCPP20Data->SetVariables.setVariableData[idx].component.name, "AlignedDataCtrlr") != NULL) && (strstr((char*)ShmOCPP20Data->SetVariables.setVariableData[idx].variable.name, "SignReadings") != NULL))
|
|
|
|
+ {
|
|
|
|
+ char tmp[ARRAY_SIZE(ShmOCPP20Data->SetVariables.setVariableData[idx].attributeValue)];
|
|
|
|
+
|
|
|
|
+ for(int tmpidx=0;tmpidx<ARRAY_SIZE(tmp);tmpidx++)
|
|
|
|
+ tmp[tmpidx] = tolower(ShmOCPP20Data->SetVariables.setVariableData[idx].attributeValue[tmpidx]);
|
|
|
|
+ if((strstr((char*)tmp, "true") != NULL) || (strstr((char*)tmp, "false") != NULL))
|
|
|
|
+ {
|
|
|
|
+ strcpy((char*)ShmOCPP20Data->SetVariables.setVariableData[idx].attributeValue,(strstr((char*)tmp, "true") != NULL)? "true" : "false");
|
|
|
|
+ strcpy((char*)ShmOCPP20Data->SetVariables.Response_setVariableResult[idx].attributeStatus, SetVariableStatusEnumTypeStr[SetVariableStatusEnumType_Accepted]);
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ strcpy((char*)ShmOCPP20Data->SetVariables.Response_setVariableResult[idx].attributeStatus, SetVariableStatusEnumTypeStr[SetVariableStatusEnumType_Rejected]);
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
if((strstr((char*)ShmOCPP20Data->SetVariables.setVariableData[idx].component.name, "SampledDataCtrlr") != NULL) && (strstr((char*)ShmOCPP20Data->SetVariables.setVariableData[idx].variable.name, "TxUpdatedInterval") != NULL))
|
|
if((strstr((char*)ShmOCPP20Data->SetVariables.setVariableData[idx].component.name, "SampledDataCtrlr") != NULL) && (strstr((char*)ShmOCPP20Data->SetVariables.setVariableData[idx].variable.name, "TxUpdatedInterval") != NULL))
|
|
{
|
|
{
|
|
if((0 < atoi((char*)ShmOCPP20Data->SetVariables.setVariableData[idx].attributeValue)) && (atoi((char*)ShmOCPP20Data->SetVariables.setVariableData[idx].attributeValue) < (int)ShmOCPP20Data->ControllerComponentVariable[idx_var].variableCharacteristics.minLimit) )
|
|
if((0 < atoi((char*)ShmOCPP20Data->SetVariables.setVariableData[idx].attributeValue)) && (atoi((char*)ShmOCPP20Data->SetVariables.setVariableData[idx].attributeValue) < (int)ShmOCPP20Data->ControllerComponentVariable[idx_var].variableCharacteristics.minLimit) )
|
|
@@ -19609,6 +19675,7 @@ int handleSetVariablesRequest(char *uuid, char *payload)
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
|
|
+ // When there is no matched variable, check the component name again
|
|
if(strstr((char*)ShmOCPP20Data->ControllerComponentVariable[idx_var].component.name, (char*)ShmOCPP20Data->SetVariables.setVariableData[idx].component.name) != NULL)
|
|
if(strstr((char*)ShmOCPP20Data->ControllerComponentVariable[idx_var].component.name, (char*)ShmOCPP20Data->SetVariables.setVariableData[idx].component.name) != NULL)
|
|
{
|
|
{
|
|
isUnknownComponent = FALSE;
|
|
isUnknownComponent = FALSE;
|