X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fcharging-station%2Focpp%2F1.6%2FOCPP16RequestService.ts;h=afc4773d3cbc34914991faad8df89f6cdffbd4a9;hb=ed6cfcff3ef6596cdf76c68f600effcb25dece72;hp=699a413d242b4aa5cf0748e51d7c65204d57b006;hpb=7acb3f7bb991a6d02a4521c0cbc5f163aa5e8a61;p=e-mobility-charging-stations-simulator.git diff --git a/src/charging-station/ocpp/1.6/OCPP16RequestService.ts b/src/charging-station/ocpp/1.6/OCPP16RequestService.ts index 699a413d..afc4773d 100644 --- a/src/charging-station/ocpp/1.6/OCPP16RequestService.ts +++ b/src/charging-station/ocpp/1.6/OCPP16RequestService.ts @@ -27,7 +27,6 @@ import Constants from '../../../utils/Constants'; import logger from '../../../utils/Logger'; import Utils from '../../../utils/Utils'; import type ChargingStation from '../../ChargingStation'; -import { ChargingStationUtils } from '../../ChargingStationUtils'; import OCPPRequestService from '../OCPPRequestService'; import type OCPPResponseService from '../OCPPResponseService'; import { OCPP16ServiceUtils } from './OCPP16ServiceUtils'; @@ -150,7 +149,7 @@ export default class OCPP16RequestService extends OCPPRequestService { commandParams?: JsonType, params?: RequestParams ): Promise { - if (ChargingStationUtils.isRequestCommandSupported(commandName, chargingStation)) { + if (OCPP16ServiceUtils.isRequestCommandSupported(chargingStation, commandName) === true) { const requestPayload = this.buildRequestPayload( chargingStation, commandName, @@ -165,6 +164,7 @@ export default class OCPP16RequestService extends OCPPRequestService { params )) as unknown as ResponseType; } + // OCPPError usage here is debatable: it's an error in the OCPP stack but not targeted to sendError(). throw new OCPPError( ErrorType.NOT_SUPPORTED, `Unsupported OCPP command '${commandName}'`, @@ -269,6 +269,7 @@ export default class OCPP16RequestService extends OCPPRequestService { }), } as unknown as Request; default: + // OCPPError usage here is debatable: it's an error in the OCPP stack but not targeted to sendError(). throw new OCPPError( ErrorType.NOT_SUPPORTED, // eslint-disable-next-line @typescript-eslint/restrict-template-expressions