X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fcharging-station%2FChargingStation.ts;h=dbabf1e5f118501de1e9f55c0266a2630b7d2c63;hb=689dca78d8b50e58be603005695da60ae3070544;hp=5c83b7f2b9a044d456b8199156e7d09d40c26386;hpb=e71712800639b0aaebec9af189fdbbaa4f453b92;p=e-mobility-charging-stations-simulator.git 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;