Rename result to response
authorJérôme Benoit <jerome.benoit@sap.com>
Wed, 27 Apr 2022 21:11:43 +0000 (23:11 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Wed, 27 Apr 2022 21:11:43 +0000 (23:11 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
src/charging-station/ocpp/1.6/OCPP16IncomingRequestService.ts
src/charging-station/ocpp/OCPPRequestService.ts

index 4ef74b04c85ec43addbd86484f5bae922653c4c5..8dc9135fa7b80e314b0880214fd029f0f7c9a8db 100644 (file)
@@ -131,7 +131,7 @@ export default class OCPP16IncomingRequestService extends OCPPIncomingRequestSer
     commandName: OCPP16IncomingRequestCommand,
     commandPayload: JsonType
   ): Promise<void> {
-    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
index 704838e960c0638eeef967f3480a303bca78f9c3..e71409056552773921a8f45cf710454e6e354080 100644 (file)
@@ -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<ResponseType> {
     try {
-      // Send result message
+      // Send response message
       return await this.internalSendMessage(
         messageId,
         messagePayload,