From c75a66757c7a26aa7b9fbdbcaaed413c77a45df1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Wed, 27 Apr 2022 23:11:43 +0200 Subject: [PATCH] Rename result to response MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- .../ocpp/1.6/OCPP16IncomingRequestService.ts | 10 +++++----- src/charging-station/ocpp/OCPPRequestService.ts | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) 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, -- 2.34.1