}
get wsConnectionUrl(): URL {
- return this.getSupervisionURLOCPPConfiguration() ? new URL(this.getConfigurationKey(this.stationInfo.supervisionURLOCPPKey ?? VendorDefaultParametersKey.ConnectionUrl).value + '/' + this.stationInfo.chargingStationId) : this.wsConfiguredConnectionUrl;
+ return this.getSupervisionUrlOcppConfiguration() ? new URL(this.getConfigurationKey(this.stationInfo.supervisionUrlOcppKey ?? VendorDefaultParametersKey.ConnectionUrl).value + '/' + this.stationInfo.chargingStationId) : this.wsConfiguredConnectionUrl;
}
public logPrefix(): string {
}
}
- private getSupervisionURLOCPPConfiguration(): boolean {
- return this.stationInfo.supervisionURLOCPPConfiguration ?? false;
+ private getSupervisionUrlOcppConfiguration(): boolean {
+ return this.stationInfo.supervisionUrlOcppConfiguration ?? false;
}
private getChargingStationId(stationTemplate: ChargingStationTemplate): string {
return stationInfo;
}
- private getOCPPVersion(): OCPPVersion {
+ private getOcppVersion(): OCPPVersion {
return this.stationInfo.ocppVersion ? this.stationInfo.ocppVersion : OCPPVersion.VERSION_16;
}
this.initializeConnectorStatus(connectorId);
}
}
- this.wsConfiguredConnectionUrl = new URL(this.getConfiguredSupervisionURL().href + '/' + this.stationInfo.chargingStationId);
- switch (this.getOCPPVersion()) {
+ this.wsConfiguredConnectionUrl = new URL(this.getConfiguredSupervisionUrl().href + '/' + this.stationInfo.chargingStationId);
+ switch (this.getOcppVersion()) {
case OCPPVersion.VERSION_16:
this.ocppIncomingRequestService = new OCPP16IncomingRequestService(this);
this.ocppRequestService = new OCPP16RequestService(this, new OCPP16ResponseService(this));
break;
default:
- this.handleUnsupportedVersion(this.getOCPPVersion());
+ this.handleUnsupportedVersion(this.getOcppVersion());
break;
}
// OCPP parameters
- this.initOCPPParameters();
+ this.initOcppParameters();
if (this.stationInfo.autoRegister) {
this.bootNotificationResponse = {
currentTime: new Date().toISOString(),
}
}
- private initOCPPParameters(): void {
- if (this.getSupervisionURLOCPPConfiguration() && !this.getConfigurationKey(this.stationInfo.supervisionURLOCPPKey ?? VendorDefaultParametersKey.ConnectionUrl)) {
- this.addConfigurationKey(VendorDefaultParametersKey.ConnectionUrl, this.getConfiguredSupervisionURL().href, { reboot: true });
+ private initOcppParameters(): void {
+ if (this.getSupervisionUrlOcppConfiguration() && !this.getConfigurationKey(this.stationInfo.supervisionUrlOcppKey ?? VendorDefaultParametersKey.ConnectionUrl)) {
+ this.addConfigurationKey(VendorDefaultParametersKey.ConnectionUrl, this.getConfiguredSupervisionUrl().href, { reboot: true });
}
if (!this.getConfigurationKey(StandardParametersKey.SupportedFeatureProfiles)) {
this.addConfigurationKey(StandardParametersKey.SupportedFeatureProfiles, `${SupportedFeatureProfiles.Core},${SupportedFeatureProfiles.Local_Auth_List_Management},${SupportedFeatureProfiles.Smart_Charging}`);
}
}
- private getConfiguredSupervisionURL(): URL {
- const supervisionUrls = Utils.cloneObject<string | string[]>(this.stationInfo.supervisionURL ?? Configuration.getSupervisionURLs());
+ private getConfiguredSupervisionUrl(): URL {
+ const supervisionUrls = Utils.cloneObject<string | string[]>(this.stationInfo.supervisionUrl ?? Configuration.getSupervisionUrls());
let indexUrl = 0;
if (!Utils.isEmptyArray(supervisionUrls)) {
if (Configuration.getDistributeStationsToTenantsEqually()) {
this.wsConnection.close();
}
let protocol: string;
- switch (this.getOCPPVersion()) {
+ switch (this.getOcppVersion()) {
case OCPPVersion.VERSION_16:
protocol = 'ocpp' + OCPPVersion.VERSION_16;
break;
default:
- this.handleUnsupportedVersion(this.getOCPPVersion());
+ this.handleUnsupportedVersion(this.getOcppVersion());
break;
}
this.wsConnection = new WebSocket(this.wsConnectionUrl, protocol, options);