X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fcharging-station%2Focpp%2FOCPPResponseService.ts;h=c77308907c6dac130338a5eb03a3ce1008b2ca0b;hb=a7529a86c56c90db6c508ba453de4cedc17a3405;hp=ab17b05ad6bf2626dd03d7db2d34a196f71d9de7;hpb=268a74bb051fcbbad532fd833f0d8fd2b33b6c64;p=e-mobility-charging-stations-simulator.git diff --git a/src/charging-station/ocpp/OCPPResponseService.ts b/src/charging-station/ocpp/OCPPResponseService.ts index ab17b05a..c7730890 100644 --- a/src/charging-station/ocpp/OCPPResponseService.ts +++ b/src/charging-station/ocpp/OCPPResponseService.ts @@ -1,7 +1,8 @@ import Ajv, { type JSONSchemaType } from 'ajv'; import ajvFormats from 'ajv-formats'; -import { OCPPServiceUtils } from './OCPPServiceUtils'; +import { OCPPServiceUtils } from './internal'; +import type { ChargingStation } from '../../charging-station'; import { OCPPError } from '../../exception'; import type { IncomingRequestCommand, @@ -10,8 +11,7 @@ import type { OCPPVersion, RequestCommand, } from '../../types'; -import { logger } from '../../utils/Logger'; -import type { ChargingStation } from '../ChargingStation'; +import { logger } from '../../utils'; const moduleName = 'OCPPResponseService'; @@ -31,8 +31,18 @@ export abstract class OCPPResponseService { multipleOfPrecision: 2, }); ajvFormats(this.ajv); - this.responseHandler.bind(this); - this.validateResponsePayload.bind(this); + this.responseHandler = this.responseHandler.bind(this) as ( + chargingStation: ChargingStation, + commandName: RequestCommand, + payload: JsonType, + requestPayload: JsonType + ) => Promise; + this.validateResponsePayload = this.validateResponsePayload.bind(this) as ( + chargingStation: ChargingStation, + commandName: RequestCommand, + schema: JSONSchemaType, + payload: T + ) => boolean; } public static getInstance(this: new () => T): T {