Forráskód Böngészése

Merge remote-tracking branch 'origin/AW-CCS'

FolusWen 3 éve
szülő
commit
c01ecfc86b
1 módosított fájl, 22 hozzáadás és 1 törlés
  1. 22 1
      EVSE/Projects/AW-CCS/Apps/main.c

+ 22 - 1
EVSE/Projects/AW-CCS/Apps/main.c

@@ -1157,6 +1157,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
 //======================================================
@@ -5504,7 +5524,8 @@ int main(void)
 						{
 							ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].StartMethod = START_METHOD_FREE;
 							ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].StartIdType = IdTokenType_NoAuthorization;
-							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);
 							setSpeaker(ON, SPEAKER_SHORT);
 							DEBUG_INFO("Start Method : FREE...\n");
 						}