+ protected validateResponsePayload<T extends JsonType>(
+ chargingStation: ChargingStation,
+ commandName: RequestCommand,
+ schema: JSONSchemaType<T>,
+ payload: T,
+ ): boolean {
+ if (chargingStation.getOcppStrictCompliance() === false) {
+ return true;
+ }
+ const validate = this.ajv.compile(schema);
+ if (validate(payload)) {
+ return true;
+ }
+ logger.error(
+ `${chargingStation.logPrefix()} ${moduleName}.validateResponsePayload: Command '${commandName}' response PDU is invalid: %j`,
+ validate.errors,
+ );
+ throw new OCPPError(
+ OCPPServiceUtils.ajvErrorsToErrorType(validate.errors!),
+ 'Response PDU is invalid',
+ commandName,
+ JSON.stringify(validate.errors, null, 2),
+ );
+ }
+
+ protected emptyResponseHandler() {
+ /* This is intentional */
+ }
+
+ public abstract responseHandler<ReqType extends JsonType, ResType extends JsonType>(