X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fcharging-station%2Focpp%2F1.6%2FOCPP16RequestService.ts;h=75e113d21162efaecb375b069ab60e124552242c;hb=dc6617020896c78ee5b3d4ef2513c98b4d61f06f;hp=3d91576bb5b85b41e667e5354174ae2d815ac119;hpb=f22266fd29f7f11ba883d7f799ef607be05d4232;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 3d91576b..75e113d2 100644 --- a/src/charging-station/ocpp/1.6/OCPP16RequestService.ts +++ b/src/charging-station/ocpp/1.6/OCPP16RequestService.ts @@ -9,7 +9,7 @@ import { OCPP16ServiceUtils } from './OCPP16ServiceUtils'; import OCPPError from '../../../exception/OCPPError'; import OCPPRequestService from '../OCPPRequestService'; import type OCPPResponseService from '../OCPPResponseService'; -import { SendParams } from '../../../types/ocpp/Requests'; +import { RequestParams } from '../../../types/ocpp/Requests'; import Utils from '../../../utils/Utils'; const moduleName = 'OCPP16RequestService'; @@ -22,28 +22,28 @@ export default class OCPP16RequestService extends OCPPRequestService { super(chargingStation, ocppResponseService); } - public async sendMessageHandler( + public async requestHandler( commandName: OCPP16RequestCommand, commandParams?: JsonType, - params?: SendParams + params?: RequestParams ): Promise { if (Object.values(OCPP16RequestCommand).includes(commandName)) { return (await this.sendMessage( Utils.generateUUID(), - this.buildCommandPayload(commandName, commandParams), + this.buildRequestPayload(commandName, commandParams), commandName, params )) as unknown as Response; } throw new OCPPError( ErrorType.NOT_SUPPORTED, - `${moduleName}.sendMessageHandler: Unsupported OCPP command ${commandName}`, + `${moduleName}.requestHandler: Unsupported OCPP command ${commandName}`, commandName, { commandName } ); } - private buildCommandPayload( + private buildRequestPayload( commandName: OCPP16RequestCommand, commandParams?: JsonType ): Request { @@ -133,7 +133,7 @@ export default class OCPP16RequestService extends OCPPRequestService { throw new OCPPError( ErrorType.NOT_SUPPORTED, // eslint-disable-next-line @typescript-eslint/restrict-template-expressions - `${moduleName}.buildCommandPayload: Unsupported OCPP command: ${commandName}`, + `${moduleName}.buildRequestPayload: Unsupported OCPP command: ${commandName}`, commandName, { commandName } );