From: Jérôme Benoit Date: Wed, 27 Apr 2022 21:11:43 +0000 (+0200) Subject: Rename result to response X-Git-Tag: v1.1.59~17 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=c75a66757c7a26aa7b9fbdbcaaed413c77a45df1;p=e-mobility-charging-stations-simulator.git Rename result to response Signed-off-by: Jérôme Benoit --- diff --git a/src/charging-station/ocpp/1.6/OCPP16IncomingRequestService.ts b/src/charging-station/ocpp/1.6/OCPP16IncomingRequestService.ts index 4ef74b04..8dc9135f 100644 --- a/src/charging-station/ocpp/1.6/OCPP16IncomingRequestService.ts +++ b/src/charging-station/ocpp/1.6/OCPP16IncomingRequestService.ts @@ -131,7 +131,7 @@ export default class OCPP16IncomingRequestService extends OCPPIncomingRequestSer commandName: OCPP16IncomingRequestCommand, commandPayload: JsonType ): Promise { - let result: JsonType; + let response: JsonType; if ( this.chargingStation.getOcppStrictCompliance() && this.chargingStation.isInPendingState() && @@ -154,8 +154,8 @@ export default class OCPP16IncomingRequestService extends OCPPIncomingRequestSer ) { if (this.incomingRequestHandlers.has(commandName)) { try { - // Call the method to build the result - result = await this.incomingRequestHandlers.get(commandName)(commandPayload); + // Call the method to build the response + response = await this.incomingRequestHandlers.get(commandName)(commandPayload); } catch (error) { // Log logger.error(this.chargingStation.logPrefix() + ' Handle request error: %j', error); @@ -184,8 +184,8 @@ export default class OCPP16IncomingRequestService extends OCPPIncomingRequestSer commandName ); } - // Send the built result - await this.chargingStation.ocppRequestService.sendResult(messageId, result, commandName); + // Send the built response + await this.chargingStation.ocppRequestService.sendResponse(messageId, response, commandName); } // Simulate charging station restart diff --git a/src/charging-station/ocpp/OCPPRequestService.ts b/src/charging-station/ocpp/OCPPRequestService.ts index 704838e9..e7140905 100644 --- a/src/charging-station/ocpp/OCPPRequestService.ts +++ b/src/charging-station/ocpp/OCPPRequestService.ts @@ -36,7 +36,7 @@ export default abstract class OCPPRequestService { this.chargingStation = chargingStation; this.ocppResponseService = ocppResponseService; this.requestHandler.bind(this); - this.sendResult.bind(this); + this.sendResponse.bind(this); this.sendError.bind(this); } @@ -54,13 +54,13 @@ export default abstract class OCPPRequestService { return OCPPRequestService.instances.get(chargingStation.hashId) as T; } - public async sendResult( + public async sendResponse( messageId: string, messagePayload: JsonType, commandName: IncomingRequestCommand ): Promise { try { - // Send result message + // Send response message return await this.internalSendMessage( messageId, messagePayload,