From: Jérôme Benoit Date: Sat, 20 Aug 2022 13:44:04 +0000 (+0200) Subject: Use the generic OCPPServiceUtils import where appropriate X-Git-Tag: v1.1.66~34 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=cbb3711f55d6cc41a82fe4ff7104d8083077f526;p=e-mobility-charging-stations-simulator.git Use the generic OCPPServiceUtils import where appropriate Signed-off-by: Jérôme Benoit --- diff --git a/src/charging-station/ocpp/OCPPIncomingRequestService.ts b/src/charging-station/ocpp/OCPPIncomingRequestService.ts index ef05c3af..5760e1d1 100644 --- a/src/charging-station/ocpp/OCPPIncomingRequestService.ts +++ b/src/charging-station/ocpp/OCPPIncomingRequestService.ts @@ -8,7 +8,7 @@ import { JsonType } from '../../types/JsonType'; import { IncomingRequestCommand } from '../../types/ocpp/Requests'; import logger from '../../utils/Logger'; import type ChargingStation from '../ChargingStation'; -import { OCPP16ServiceUtils } from './1.6/OCPP16ServiceUtils'; +import { OCPPServiceUtils } from './OCPPServiceUtils'; const moduleName = 'OCPPIncomingRequestService'; @@ -68,7 +68,7 @@ export default abstract class OCPPIncomingRequestService { validate.errors ); throw new OCPPError( - OCPP16ServiceUtils.AjvErrorsToErrorType(validate.errors), + OCPPServiceUtils.AjvErrorsToErrorType(validate.errors), 'Incoming request PDU is invalid', commandName, JSON.stringify(validate.errors, null, 2) diff --git a/src/charging-station/ocpp/OCPPRequestService.ts b/src/charging-station/ocpp/OCPPRequestService.ts index e4ac7868..de10f546 100644 --- a/src/charging-station/ocpp/OCPPRequestService.ts +++ b/src/charging-station/ocpp/OCPPRequestService.ts @@ -21,8 +21,8 @@ import Constants from '../../utils/Constants'; import logger from '../../utils/Logger'; import Utils from '../../utils/Utils'; import type ChargingStation from '../ChargingStation'; -import { OCPP16ServiceUtils } from './1.6/OCPP16ServiceUtils'; import type OCPPResponseService from './OCPPResponseService'; +import { OCPPServiceUtils } from './OCPPServiceUtils'; const moduleName = 'OCPPRequestService'; @@ -133,7 +133,7 @@ export default abstract class OCPPRequestService { validate.errors ); throw new OCPPError( - OCPP16ServiceUtils.AjvErrorsToErrorType(validate.errors), + OCPPServiceUtils.AjvErrorsToErrorType(validate.errors), 'Request PDU is invalid', commandName, JSON.stringify(validate.errors, null, 2) diff --git a/src/charging-station/ocpp/OCPPResponseService.ts b/src/charging-station/ocpp/OCPPResponseService.ts index 8c9cd984..c91066c4 100644 --- a/src/charging-station/ocpp/OCPPResponseService.ts +++ b/src/charging-station/ocpp/OCPPResponseService.ts @@ -7,7 +7,7 @@ import { JsonType } from '../../types/JsonType'; import { RequestCommand } from '../../types/ocpp/Requests'; import logger from '../../utils/Logger'; import type ChargingStation from '../ChargingStation'; -import { OCPP16ServiceUtils } from './1.6/OCPP16ServiceUtils'; +import { OCPPServiceUtils } from './OCPPServiceUtils'; const moduleName = 'OCPPResponseService'; @@ -45,7 +45,7 @@ export default abstract class OCPPResponseService { validate.errors ); throw new OCPPError( - OCPP16ServiceUtils.AjvErrorsToErrorType(validate.errors), + OCPPServiceUtils.AjvErrorsToErrorType(validate.errors), 'Response PDU is invalid', commandName, JSON.stringify(validate.errors, null, 2)