import Ajv from 'ajv-draft-04';
import ajvFormats from 'ajv-formats';
import OCPPError from '../../exception/OCPPError';
import PerformanceStatistics from '../../performance/PerformanceStatistics';
import Ajv from 'ajv-draft-04';
import ajvFormats from 'ajv-formats';
import OCPPError from '../../exception/OCPPError';
import PerformanceStatistics from '../../performance/PerformanceStatistics';
-import { EmptyObject } from '../../types/EmptyObject';
-import { HandleErrorParams } from '../../types/Error';
-import { JsonObject, JsonType } from '../../types/JsonType';
+import type { EmptyObject } from '../../types/EmptyObject';
+import type { HandleErrorParams } from '../../types/Error';
+import type { JsonObject, JsonType } from '../../types/JsonType';
import { ErrorType } from '../../types/ocpp/ErrorType';
import { MessageType } from '../../types/ocpp/MessageType';
import {
import { ErrorType } from '../../types/ocpp/ErrorType';
import { MessageType } from '../../types/ocpp/MessageType';
import {
import Constants from '../../utils/Constants';
import logger from '../../utils/Logger';
import Utils from '../../utils/Utils';
import type ChargingStation from '../ChargingStation';
import type OCPPResponseService from './OCPPResponseService';
import Constants from '../../utils/Constants';
import logger from '../../utils/Logger';
import Utils from '../../utils/Utils';
import type ChargingStation from '../ChargingStation';
import type OCPPResponseService from './OCPPResponseService';
protected constructor(ocppResponseService: OCPPResponseService) {
this.ocppResponseService = ocppResponseService;
protected constructor(ocppResponseService: OCPPResponseService) {
this.ocppResponseService = ocppResponseService;
this.requestHandler.bind(this);
this.sendResponse.bind(this);
this.sendError.bind(this);
this.requestHandler.bind(this);
this.sendResponse.bind(this);
this.sendError.bind(this);
}
public static getInstance<T extends OCPPRequestService>(
this: new (ocppResponseService: OCPPResponseService) => T,
ocppResponseService: OCPPResponseService
): T {
}
public static getInstance<T extends OCPPRequestService>(
this: new (ocppResponseService: OCPPResponseService) => T,
ocppResponseService: OCPPResponseService
): T {
OCPPRequestService.instance = new this(ocppResponseService);
}
return OCPPRequestService.instance as T;
OCPPRequestService.instance = new this(ocppResponseService);
}
return OCPPRequestService.instance as T;
'Request PDU is invalid',
commandName,
JSON.stringify(validate.errors, null, 2)
'Request PDU is invalid',
commandName,
JSON.stringify(validate.errors, null, 2)
* @param requestStatistic
*/
function errorCallback(error: OCPPError, requestStatistic = true): void {
* @param requestStatistic
*/
function errorCallback(error: OCPPError, requestStatistic = true): void {
chargingStation: ChargingStation,
commandName: RequestCommand,
commandParams?: JsonType,
params?: RequestParams
chargingStation: ChargingStation,
commandName: RequestCommand,
commandParams?: JsonType,
params?: RequestParams