X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fcharging-station%2Focpp%2F2.0%2FOCPP20IncomingRequestService.ts;h=0d657d99f7bd67b365660c3e2888653157485e5c;hb=969c488ddeab6f7fb11a376a4a4d1db497aef96d;hp=bda78d54f3147f5eb621ae5108836c34eea8ee6d;hpb=9429aa42d725c4b42c30e0134d75b363aed412f0;p=e-mobility-charging-stations-simulator.git diff --git a/src/charging-station/ocpp/2.0/OCPP20IncomingRequestService.ts b/src/charging-station/ocpp/2.0/OCPP20IncomingRequestService.ts index bda78d54..0d657d99 100644 --- a/src/charging-station/ocpp/2.0/OCPP20IncomingRequestService.ts +++ b/src/charging-station/ocpp/2.0/OCPP20IncomingRequestService.ts @@ -8,7 +8,6 @@ import { OCPPError } from '../../../exception'; import { ErrorType, type IncomingRequestHandler, - type JsonObject, type JsonType, type OCPP20ClearCacheRequest, OCPP20IncomingRequestCommand, @@ -20,7 +19,7 @@ import { OCPPIncomingRequestService } from '../OCPPIncomingRequestService'; const moduleName = 'OCPP20IncomingRequestService'; export class OCPP20IncomingRequestService extends OCPPIncomingRequestService { - protected jsonSchemas: Map>; + protected jsonSchemas: Map>; private incomingRequestHandlers: Map; public constructor() { @@ -31,7 +30,7 @@ export class OCPP20IncomingRequestService extends OCPPIncomingRequestService { this.incomingRequestHandlers = new Map([ [OCPP20IncomingRequestCommand.CLEAR_CACHE, this.handleRequestClearCache.bind(this)], ]); - this.jsonSchemas = new Map>([ + this.jsonSchemas = new Map>([ [ OCPP20IncomingRequestCommand.CLEAR_CACHE, OCPP20ServiceUtils.parseJsonSchemaFile( @@ -56,7 +55,7 @@ export class OCPP20IncomingRequestService extends OCPPIncomingRequestService { ): Promise { let response: ResType; if ( - chargingStation.getOcppStrictCompliance() === true && + chargingStation.stationInfo?.ocppStrictCompliance === true && chargingStation.inPendingState() === true && (commandName === OCPP20IncomingRequestCommand.REQUEST_START_TRANSACTION || commandName === OCPP20IncomingRequestCommand.REQUEST_STOP_TRANSACTION) @@ -65,7 +64,7 @@ export class OCPP20IncomingRequestService extends OCPPIncomingRequestService { ErrorType.SECURITY_ERROR, `${commandName} cannot be issued to handle request PDU ${JSON.stringify( commandPayload, - null, + undefined, 2, )} while the charging station is in pending state on the central server`, commandName, @@ -74,7 +73,7 @@ export class OCPP20IncomingRequestService extends OCPPIncomingRequestService { } if ( chargingStation.isRegistered() === true || - (chargingStation.getOcppStrictCompliance() === false && + (chargingStation.stationInfo?.ocppStrictCompliance === false && chargingStation.inUnknownState() === true) ) { if ( @@ -102,7 +101,7 @@ export class OCPP20IncomingRequestService extends OCPPIncomingRequestService { ErrorType.NOT_IMPLEMENTED, `${commandName} is not implemented to handle request PDU ${JSON.stringify( commandPayload, - null, + undefined, 2, )}`, commandName, @@ -114,7 +113,7 @@ export class OCPP20IncomingRequestService extends OCPPIncomingRequestService { ErrorType.SECURITY_ERROR, `${commandName} cannot be issued to handle request PDU ${JSON.stringify( commandPayload, - null, + undefined, 2, )} while the charging station is not registered on the central server.`, commandName,