- JSON.parse(
- fs.readFileSync(
- path.resolve(
- path.dirname(fileURLToPath(import.meta.url)),
- '../../../assets/json-schemas/ocpp/2.0/BootNotificationResponse.json'
- ),
- 'utf8'
+ this.handleResponseBootNotification.bind(this) as ResponseHandler
+ ],
+ [OCPP20RequestCommand.HEARTBEAT, this.emptyResponseHandler],
+ [OCPP20RequestCommand.STATUS_NOTIFICATION, this.emptyResponseHandler]
+ ])
+ this.payloadValidateFunctions = new Map<OCPP20RequestCommand, ValidateFunction<JsonType>>([
+ [
+ OCPP20RequestCommand.BOOT_NOTIFICATION,
+ this.ajv
+ .compile(
+ OCPP20ServiceUtils.parseJsonSchemaFile<OCPP20BootNotificationResponse>(
+ 'assets/json-schemas/ocpp/2.0/BootNotificationResponse.json',
+ moduleName,
+ 'constructor'
+ )
+ )
+ .bind(this)
+ ],
+ [
+ OCPP20RequestCommand.HEARTBEAT,
+ this.ajv
+ .compile(
+ OCPP20ServiceUtils.parseJsonSchemaFile<OCPP20HeartbeatResponse>(
+ 'assets/json-schemas/ocpp/2.0/HeartbeatResponse.json',
+ moduleName,
+ 'constructor'
+ )