Configuration,
Constants,
DCElectricUtils,
- MessageChannelUtils,
Utils,
buildChargingStationAutomaticTransactionGeneratorConfiguration,
buildConnectorsStatus,
buildEvsesStatus,
+ buildStartedMessage,
+ buildStoppedMessage,
+ buildUpdatedMessage,
handleFileException,
logger,
watchJsonFile,
}
);
this.started = true;
- parentPort?.postMessage(MessageChannelUtils.buildStartedMessage(this));
+ parentPort?.postMessage(buildStartedMessage(this));
this.starting = false;
} else {
logger.warn(`${this.logPrefix()} Charging station is already starting...`);
delete this.bootNotificationResponse;
this.started = false;
this.saveConfiguration();
- parentPort?.postMessage(MessageChannelUtils.buildStoppedMessage(this));
+ parentPort?.postMessage(buildStoppedMessage(this));
this.stopping = false;
} else {
logger.warn(`${this.logPrefix()} Charging station is already stopping...`);
this.automaticTransactionGenerator?.start();
}
this.saveAutomaticTransactionGeneratorConfiguration();
- parentPort?.postMessage(MessageChannelUtils.buildUpdatedMessage(this));
+ parentPort?.postMessage(buildUpdatedMessage(this));
}
public stopAutomaticTransactionGenerator(connectorIds?: number[]): void {
this.automaticTransactionGenerator?.stop();
}
this.saveAutomaticTransactionGeneratorConfiguration();
- parentPort?.postMessage(MessageChannelUtils.buildUpdatedMessage(this));
+ parentPort?.postMessage(buildUpdatedMessage(this));
}
public async stopTransactionOnConnector(
}
this.wsConnectionRestarted = false;
this.autoReconnectRetryCount = 0;
- parentPort?.postMessage(MessageChannelUtils.buildUpdatedMessage(this));
+ parentPort?.postMessage(buildUpdatedMessage(this));
} else {
logger.warn(
`${this.logPrefix()} Connection to OCPP server through ${this.wsConnectionUrl.toString()} failed`
this.started === true && (await this.reconnect());
break;
}
- parentPort?.postMessage(MessageChannelUtils.buildUpdatedMessage(this));
+ parentPort?.postMessage(buildUpdatedMessage(this));
}
private getCachedRequest(messageType: MessageType, messageId: string): CachedRequest | undefined {
logger.error(`${this.logPrefix()} ${errorMsg}`);
throw new OCPPError(ErrorType.PROTOCOL_ERROR, errorMsg);
}
- parentPort?.postMessage(MessageChannelUtils.buildUpdatedMessage(this));
+ parentPort?.postMessage(buildUpdatedMessage(this));
} else {
throw new OCPPError(ErrorType.PROTOCOL_ERROR, 'Incoming message is not an array', null, {
request,