From: Jérôme Benoit Date: Sat, 21 Aug 2021 20:06:59 +0000 (+0200) Subject: Cleanup: rename isWebSocketOpened to isWebSocketConnectionOpened X-Git-Tag: v1.0.40~4 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=d5bff457459d6ca6cae1c14483f83daaf22e2907;p=e-mobility-charging-stations-simulator.git Cleanup: rename isWebSocketOpened to isWebSocketConnectionOpened Signed-off-by: Jérôme Benoit --- diff --git a/src/charging-station/ChargingStation.ts b/src/charging-station/ChargingStation.ts index 5c83b7f2..dbabf1e5 100644 --- a/src/charging-station/ChargingStation.ts +++ b/src/charging-station/ChargingStation.ts @@ -103,7 +103,7 @@ export default class ChargingStation { } } - public isWebSocketOpen(): boolean { + public isWebSocketConnectionOpened(): boolean { return this.wsConnection?.readyState === WebSocket.OPEN; } @@ -330,7 +330,7 @@ export default class ChargingStation { this.getConnector(Utils.convertToInt(connector)).status = ChargePointStatus.UNAVAILABLE; } } - if (this.isWebSocketOpen()) { + if (this.isWebSocketConnectionOpened()) { this.wsConnection.close(); } if (this.getEnableStatistics()) { @@ -613,7 +613,7 @@ export default class ChargingStation { if (this.isRegistered()) { await this.startMessageSequence(); this.hasStopped && (this.hasStopped = false); - if (this.hasSocketRestarted && this.isWebSocketOpen()) { + if (this.hasSocketRestarted && this.isWebSocketConnectionOpened()) { this.flushMessageQueue(); } } else { @@ -887,7 +887,7 @@ export default class ChargingStation { : 0; if (webSocketPingInterval > 0 && !this.webSocketPingSetInterval) { this.webSocketPingSetInterval = setInterval(() => { - if (this.isWebSocketOpen()) { + if (this.isWebSocketConnectionOpened()) { this.wsConnection.ping((): void => { }); } }, webSocketPingInterval * 1000); @@ -945,7 +945,7 @@ export default class ChargingStation { if (!Utils.isNullOrUndefined(this.stationInfo.supervisionUser) && !Utils.isNullOrUndefined(this.stationInfo.supervisionPassword)) { options.auth = `${this.stationInfo.supervisionUser}:${this.stationInfo.supervisionPassword}`; } - if (this.isWebSocketOpen() && forceCloseOpened) { + if (this.isWebSocketConnectionOpened() && forceCloseOpened) { this.wsConnection.close(); } let protocol; diff --git a/src/charging-station/ocpp/OCPPRequestService.ts b/src/charging-station/ocpp/OCPPRequestService.ts index ccc6fc2b..5b1f981c 100644 --- a/src/charging-station/ocpp/OCPPRequestService.ts +++ b/src/charging-station/ocpp/OCPPRequestService.ts @@ -49,7 +49,7 @@ export default abstract class OCPPRequestService { break; } // Check if wsConnection opened and charging station registered - if (this.chargingStation.isWebSocketOpen() && (this.chargingStation.isRegistered() || commandName === RequestCommand.BOOT_NOTIFICATION)) { + if (this.chargingStation.isWebSocketConnectionOpened() && (this.chargingStation.isRegistered() || commandName === RequestCommand.BOOT_NOTIFICATION)) { if (this.chargingStation.getEnableStatistics()) { this.chargingStation.performanceStatistics.addRequestStatistic(commandName, messageType); }