X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fcharging-station%2Focpp%2F1.6%2FOCPP16IncomingRequestService.ts;h=a33d0c26a60bb362f449c29d65b2bac57dd23e41;hb=7edba9a79cf60b1d1113ec89f310788194ddb97a;hp=cfb6efeacfd99700e14d99004d718ac02f3f5409;hpb=649287f8075bb01539ac9084bdccf027cfc50e89;p=e-mobility-charging-stations-simulator.git diff --git a/src/charging-station/ocpp/1.6/OCPP16IncomingRequestService.ts b/src/charging-station/ocpp/1.6/OCPP16IncomingRequestService.ts index cfb6efea..a33d0c26 100644 --- a/src/charging-station/ocpp/1.6/OCPP16IncomingRequestService.ts +++ b/src/charging-station/ocpp/1.6/OCPP16IncomingRequestService.ts @@ -8,6 +8,8 @@ import type { JSONSchemaType } from 'ajv'; import { Client, type FTPResponse } from 'basic-ftp'; import tar from 'tar'; +import { OCPP16Constants } from './OCPP16Constants'; +import { OCPP16ServiceUtils } from './OCPP16ServiceUtils'; import { type ChargingStation, ChargingStationConfigurationUtils, @@ -83,7 +85,7 @@ import { type UnlockConnectorResponse, } from '../../../types'; import { Constants, Utils, logger } from '../../../utils'; -import { OCPP16Constants, OCPP16ServiceUtils, OCPPIncomingRequestService } from '../internal'; +import { OCPPIncomingRequestService } from '../OCPPIncomingRequestService'; const moduleName = 'OCPP16IncomingRequestService'; @@ -275,7 +277,7 @@ export class OCPP16IncomingRequestService extends OCPPIncomingRequestService { let response: JsonType; if ( chargingStation.getOcppStrictCompliance() === true && - chargingStation.isInPendingState() === true && + chargingStation.inPendingState() === true && (commandName === OCPP16IncomingRequestCommand.REMOTE_START_TRANSACTION || commandName === OCPP16IncomingRequestCommand.REMOTE_STOP_TRANSACTION) ) { @@ -293,7 +295,7 @@ export class OCPP16IncomingRequestService extends OCPPIncomingRequestService { if ( chargingStation.isRegistered() === true || (chargingStation.getOcppStrictCompliance() === false && - chargingStation.isInUnknownState() === true) + chargingStation.inUnknownState() === true) ) { if ( this.incomingRequestHandlers.has(commandName) === true && @@ -486,9 +488,9 @@ export class OCPP16IncomingRequestService extends OCPPIncomingRequestService { ); if (!keyToChange) { return OCPP16Constants.OCPP_CONFIGURATION_RESPONSE_NOT_SUPPORTED; - } else if (keyToChange && keyToChange.readonly) { + } else if (keyToChange?.readonly === true) { return OCPP16Constants.OCPP_CONFIGURATION_RESPONSE_REJECTED; - } else if (keyToChange && !keyToChange.readonly) { + } else if (keyToChange?.readonly === false) { let valueChanged = false; if (keyToChange.value !== commandPayload.value) { ChargingStationConfigurationUtils.setConfigurationKeyValue(