messageId: string,
messagePayload: JsonType,
commandName: IncomingRequestCommand
- ): Promise<ResponseType | undefined> {
+ ): Promise<ResponseType> {
try {
// Send response message
return await this.internalSendMessage(
return Utils.promiseWithTimeout(
new Promise((resolve, reject) => {
if (chargingStation.getEnableStatistics() === true) {
- chargingStation.performanceStatistics.addRequestStatistic(commandName, messageType);
+ chargingStation.performanceStatistics?.addRequestStatistic(commandName, messageType);
}
const messageToSend = this.buildMessageToSend(
chargingStation,
*/
function responseCallback(payload: JsonType, requestPayload: JsonType): void {
if (chargingStation.getEnableStatistics() === true) {
- chargingStation.performanceStatistics.addRequestStatistic(
+ chargingStation.performanceStatistics?.addRequestStatistic(
commandName,
MessageType.CALL_RESULT_MESSAGE
);
*/
function errorCallback(error: OCPPError, requestStatistic = true): void {
if (requestStatistic === true && chargingStation.getEnableStatistics() === true) {
- chargingStation.performanceStatistics.addRequestStatistic(
+ chargingStation.performanceStatistics?.addRequestStatistic(
commandName,
MessageType.CALL_ERROR_MESSAGE
);