this.getConnectorStatus(connectorId).status = ChargePointStatus.UNAVAILABLE;
}
}
- if (this.isWebSocketConnectionOpened()) {
- this.wsConnection.close();
- }
+ this.closeWSConnection();
if (this.getEnableStatistics()) {
this.performanceStatistics.stop();
}
) {
options.auth = `${this.stationInfo.supervisionUser}:${this.stationInfo.supervisionPassword}`;
}
- if (this.isWebSocketConnectionOpened() && params?.closeOpened) {
- this.wsConnection.close();
+ if (params?.closeOpened) {
+ this.closeWSConnection();
}
- if (this.isWebSocketConnectionOpened() && params?.terminateOpened) {
- this.wsConnection.terminate();
+ if (params?.terminateOpened) {
+ this.terminateWSConnection();
}
let protocol: string;
switch (this.getOcppVersion()) {
);
}
+ private closeWSConnection(): void {
+ if (this.isWebSocketConnectionOpened()) {
+ this.wsConnection.close();
+ this.wsConnection = null;
+ }
+ }
+
+ private terminateWSConnection(): void {
+ if (this.isWebSocketConnectionOpened()) {
+ this.wsConnection.terminate();
+ this.wsConnection = null;
+ }
+ }
+
private stopMeterValues(connectorId: number) {
if (this.getConnectorStatus(connectorId)?.transactionSetInterval) {
clearInterval(this.getConnectorStatus(connectorId).transactionSetInterval);