|
@@ -420,6 +420,22 @@ void ocpp_process_start()
|
|
|
system("/root/OcppBackend20 &");
|
|
|
}
|
|
|
|
|
|
+uint8_t ocpp_get_isRemoteStartWait()
|
|
|
+{
|
|
|
+ uint8_t result = OFF;
|
|
|
+
|
|
|
+ if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
+ {
|
|
|
+ result = ShmOCPP16Data->MsMsg.bits.isRemoteStartWaitReq;
|
|
|
+ }
|
|
|
+ else if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
+ {
|
|
|
+ result = ShmOCPP20Data->MsMsg.bits.isRemoteStartWaitReq;
|
|
|
+ }
|
|
|
+
|
|
|
+ return result;
|
|
|
+}
|
|
|
+
|
|
|
uint8_t ocpp_get_connection_status()
|
|
|
{
|
|
|
uint8_t result = OFF;
|
|
@@ -1073,6 +1089,26 @@ uint8_t ocpp_isAuthorizeRemoteStart()
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
+uint8_t ocpp_get_freevend_idtag(uint8_t * userId)
|
|
|
+{
|
|
|
+ uint8_t result = NO;
|
|
|
+
|
|
|
+ if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
+ {
|
|
|
+ strcpy((char*)userId, (char*)ShmOCPP16Data->ConfigurationTable.CoreProfile[FreeVendIdtag].ItemData);
|
|
|
+
|
|
|
+ result = YES;
|
|
|
+ }
|
|
|
+ else if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
+ {
|
|
|
+ strcpy((char*)userId, (char*)ShmOCPP20Data->ControllerComponentVariable[ChargingStation_FreeVendIdtag].variableAttribute[0].value);
|
|
|
+
|
|
|
+ result = YES;
|
|
|
+ }
|
|
|
+
|
|
|
+ return result;
|
|
|
+}
|
|
|
+
|
|
|
//======================================================
|
|
|
// Check interface status
|
|
|
//======================================================
|
|
@@ -3500,6 +3536,7 @@ void checkStopReason(uint8_t gun_index)
|
|
|
else if(ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PilotState == CP_STATE_A)
|
|
|
{
|
|
|
sprintf((char*)ShmOCPP16Data->StopTransaction[gun_index].StopReason, "EVDisconnected");
|
|
|
+ memcpy((char*)ShmOCPP16Data->StopTransaction[gun_index].IdTag, (char*)ShmOCPP16Data->StartTransaction[gun_index].IdTag, ARRAY_SIZE(ShmOCPP16Data->StopTransaction[gun_index].IdTag));
|
|
|
}
|
|
|
else if(ShmOCPP16Data->MsMsg.bits.ResetReq)
|
|
|
{
|
|
@@ -3511,7 +3548,6 @@ void checkStopReason(uint8_t gun_index)
|
|
|
else if(ShmCharger->gun_info[gun_index].rfidReq || ShmCharger->gun_info[gun_index].bleConfigData.isRequestStop)
|
|
|
{
|
|
|
sprintf((char*)ShmOCPP16Data->StopTransaction[gun_index].StopReason, "Local");
|
|
|
-
|
|
|
if(!isMatchStartUser(gun_index))
|
|
|
{
|
|
|
memcpy((char*)ShmOCPP16Data->StopTransaction[gun_index].IdTag, (char*)ShmSysConfigAndInfo->SysConfig.UserId, ARRAY_SIZE(ShmOCPP16Data->StopTransaction[gun_index].IdTag));
|
|
@@ -3520,8 +3556,7 @@ void checkStopReason(uint8_t gun_index)
|
|
|
{
|
|
|
memcpy((char*)ShmOCPP16Data->StopTransaction[gun_index].IdTag, (char*)ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].StartUserId, ARRAY_SIZE(ShmOCPP16Data->StopTransaction[gun_index].IdTag));
|
|
|
}
|
|
|
-
|
|
|
- DEBUG_INFO("Gun-%d [ IdTag ] : %s \n", gun_index, ShmOCPP16Data->StopTransaction[gun_index].IdTag);
|
|
|
+ DEBUG_INFO("Gun-[%d] : IdTag [ %s ].\n", gun_index, ShmOCPP16Data->StopTransaction[gun_index].IdTag);
|
|
|
}
|
|
|
else if(ShmOCPP16Data->CsMsg.bits[gun_index].RemoteStopTransactionReq)
|
|
|
{
|
|
@@ -3535,7 +3570,7 @@ void checkStopReason(uint8_t gun_index)
|
|
|
{
|
|
|
sprintf((char*)ShmOCPP16Data->StopTransaction[gun_index].StopReason, "Other");
|
|
|
}
|
|
|
- DEBUG_INFO("Gun-%d : StopReason [ %s ]...\n",gun_index,ShmOCPP16Data->StopTransaction[gun_index].StopReason);
|
|
|
+ DEBUG_INFO("Gun-[%d] : StopReason [ %s ].\n",gun_index,ShmOCPP16Data->StopTransaction[gun_index].StopReason);
|
|
|
|
|
|
ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PowerConsumption = (ShmCharger->gun_info[gun_index].powerConsumption.power_consumption/100.0);
|
|
|
ShmOCPP16Data->CpMsg.bits[gun_index].StopTransactionReq = ON;
|
|
@@ -3569,7 +3604,6 @@ void checkStopReason(uint8_t gun_index)
|
|
|
else if(ShmCharger->gun_info[gun_index].rfidReq || ShmCharger->gun_info[gun_index].bleConfigData.isRequestStop)
|
|
|
{
|
|
|
sprintf((char*)ShmOCPP20Data->TransactionEvent[gun_index].transactionInfo.stoppedReason, "Local");
|
|
|
-
|
|
|
if(!isMatchStartUser(gun_index))
|
|
|
{
|
|
|
memcpy((char*)ShmOCPP20Data->TransactionEvent[gun_index].idToken.idToken, (char*)ShmSysConfigAndInfo->SysConfig.UserId, ARRAY_SIZE(ShmOCPP20Data->TransactionEvent[gun_index].idToken.idToken));
|
|
@@ -3578,8 +3612,7 @@ void checkStopReason(uint8_t gun_index)
|
|
|
{
|
|
|
memcpy((char*)ShmOCPP20Data->TransactionEvent[gun_index].idToken.idToken, (char*)ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].StartUserId, ARRAY_SIZE(ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].StartUserId));
|
|
|
}
|
|
|
-
|
|
|
- DEBUG_INFO("Gun-%d [ idToken ] : %s \n", gun_index, ShmOCPP20Data->TransactionEvent[gun_index].idToken.idToken);
|
|
|
+ DEBUG_INFO("Gun-[%d] : idToken [ %s ].\n", gun_index, ShmOCPP20Data->TransactionEvent[gun_index].idToken.idToken);
|
|
|
}
|
|
|
else if((ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode & ALARM_OVER_CURRENT))
|
|
|
{
|
|
@@ -3597,7 +3630,7 @@ void checkStopReason(uint8_t gun_index)
|
|
|
{
|
|
|
sprintf((char*)ShmOCPP20Data->TransactionEvent[gun_index].transactionInfo.stoppedReason, "Other");
|
|
|
}
|
|
|
- DEBUG_INFO("Gun-%d : StopReason [ %s ]...\n", gun_index, ShmOCPP20Data->TransactionEvent[gun_index].transactionInfo.stoppedReason);
|
|
|
+ DEBUG_INFO("Gun-[%d] : StopReason [ %s ].\n", gun_index, ShmOCPP20Data->TransactionEvent[gun_index].transactionInfo.stoppedReason);
|
|
|
|
|
|
ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PowerConsumption = (ShmCharger->gun_info[gun_index].powerConsumption.power_consumption/100.0);
|
|
|
ShmOCPP20Data->CpMsg.bits[gun_index].TransactionEventReq = ON;
|
|
@@ -3955,6 +3988,11 @@ int main(void)
|
|
|
ocpp_set_stoptransaction_conf(gun_index, OFF);
|
|
|
}
|
|
|
|
|
|
+ if(ocpp_get_isRemoteStartWait())
|
|
|
+ setLedMotion(gun_index,LED_ACTION_CONNECTED);
|
|
|
+ else
|
|
|
+ setLedMotion(gun_index,LED_ACTION_IDLE);
|
|
|
+
|
|
|
if(((ShmSysConfigAndInfo->SysConfig.AuthorisationMode == AUTH_MODE_DISABLE) && (ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PilotState == CP_STATE_B)) ||
|
|
|
((ShmSysConfigAndInfo->SysConfig.AuthorisationMode == AUTH_MODE_DISABLE) && (ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PilotState == CP_STATE_C)) ||
|
|
|
(ShmCharger->gun_info[gun_index].rfidReq == ON) ||
|
|
@@ -4027,7 +4065,8 @@ int main(void)
|
|
|
else
|
|
|
{
|
|
|
ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].StartMethod = START_METHOD_FREE;
|
|
|
- memcpy(ShmSysConfigAndInfo->SysConfig.UserId, ShmSysConfigAndInfo->SysConfig.SerialNumber, ARRAY_SIZE(ShmSysConfigAndInfo->SysConfig.SerialNumber));
|
|
|
+ //memcpy(ShmSysConfigAndInfo->SysConfig.UserId, ShmSysConfigAndInfo->SysConfig.SerialNumber, ARRAY_SIZE(ShmSysConfigAndInfo->SysConfig.SerialNumber));
|
|
|
+ ocpp_get_freevend_idtag(ShmSysConfigAndInfo->SysConfig.UserId);
|
|
|
DEBUG_INFO("Start Method : FREE...\n");
|
|
|
}
|
|
|
|