import type { JSONSchemaType } from 'ajv';
+import { OCPP20ServiceUtils } from './OCPP20ServiceUtils';
import type { ChargingStation } from '../../../charging-station';
import { OCPPError } from '../../../exception';
import {
OCPPVersion,
} from '../../../types';
import { logger } from '../../../utils';
-import { OCPP20ServiceUtils, OCPPIncomingRequestService } from '../internal';
+import { OCPPIncomingRequestService } from '../OCPPIncomingRequestService';
const moduleName = 'OCPP20IncomingRequestService';
[
OCPP20IncomingRequestCommand.CLEAR_CACHE,
OCPP20ServiceUtils.parseJsonSchemaFile<OCPP20ClearCacheRequest>(
- '../../../assets/json-schemas/ocpp/2.0/ClearCacheRequest.json',
+ 'assets/json-schemas/ocpp/2.0/ClearCacheRequest.json',
moduleName,
'constructor'
),
],
]);
- this.validatePayload.bind(this);
+ this.validatePayload = this.validatePayload.bind(this) as (
+ chargingStation: ChargingStation,
+ commandName: OCPP20IncomingRequestCommand,
+ commandPayload: JsonType
+ ) => boolean;
}
public async incomingRequestHandler(
let response: JsonType;
if (
chargingStation.getOcppStrictCompliance() === true &&
- chargingStation.isInPendingState() === true &&
+ chargingStation.inPendingState() === true &&
(commandName === OCPP20IncomingRequestCommand.REQUEST_START_TRANSACTION ||
commandName === OCPP20IncomingRequestCommand.REQUEST_STOP_TRANSACTION)
) {
if (
chargingStation.isRegistered() === true ||
(chargingStation.getOcppStrictCompliance() === false &&
- chargingStation.isInUnknownState() === true)
+ chargingStation.inUnknownState() === true)
) {
if (
this.incomingRequestHandlers.has(commandName) === true &&