Fix deprecated configuration key detection in a section
[e-mobility-charging-stations-simulator.git] / src / charging-station / ocpp / 1.6 / OCPP16IncomingRequestService.ts
index b791f713ff954eb065534a5f10e561c9a8a24d3a..bd9985048c3f9fdfa0679b96c677df0e8d674249 100644 (file)
@@ -217,10 +217,13 @@ export default class OCPP16IncomingRequestService extends OCPPIncomingRequestSer
           connectorId,
           this.chargingStation.getEnergyActiveImportRegisterByTransactionId(transactionId)
         );
-        await this.chargingStation.ocppRequestService.sendTransactionEndMeterValues(
-          connectorId,
-          transactionId,
-          transactionEndMeterValue
+        await this.chargingStation.ocppRequestService.sendMessageHandler(
+          OCPP16RequestCommand.METER_VALUES,
+          {
+            connectorId,
+            transactionId,
+            meterValue: transactionEndMeterValue,
+          }
         );
       }
       const stopResponse = (await this.chargingStation.ocppRequestService.sendMessageHandler(
@@ -760,10 +763,13 @@ export default class OCPP16IncomingRequestService extends OCPPIncomingRequestSer
             connectorId,
             this.chargingStation.getEnergyActiveImportRegisterByTransactionId(transactionId)
           );
-          await this.chargingStation.ocppRequestService.sendTransactionEndMeterValues(
-            connectorId,
-            transactionId,
-            transactionEndMeterValue
+          await this.chargingStation.ocppRequestService.sendMessageHandler(
+            OCPP16RequestCommand.METER_VALUES,
+            {
+              connectorId,
+              transactionId,
+              meterValue: transactionEndMeterValue,
+            }
           );
         }
         await this.chargingStation.ocppRequestService.sendMessageHandler(
@@ -823,8 +829,11 @@ export default class OCPP16IncomingRequestService extends OCPPIncomingRequestSer
                 info.bytes / 1024
               } bytes transferred from diagnostics archive ${info.name}`
             );
-            await this.chargingStation.ocppRequestService.sendDiagnosticsStatusNotification(
-              OCPP16DiagnosticsStatus.Uploading
+            await this.chargingStation.ocppRequestService.sendMessageHandler(
+              OCPP16RequestCommand.DIAGNOSTICS_STATUS_NOTIFICATION,
+              {
+                status: OCPP16DiagnosticsStatus.Uploading,
+              }
             );
           });
           uploadResponse = await ftpClient.uploadFrom(
@@ -832,8 +841,11 @@ export default class OCPP16IncomingRequestService extends OCPPIncomingRequestSer
             uri.pathname + diagnosticsArchive
           );
           if (uploadResponse.code === 226) {
-            await this.chargingStation.ocppRequestService.sendDiagnosticsStatusNotification(
-              OCPP16DiagnosticsStatus.Uploaded
+            await this.chargingStation.ocppRequestService.sendMessageHandler(
+              OCPP16RequestCommand.DIAGNOSTICS_STATUS_NOTIFICATION,
+              {
+                status: OCPP16DiagnosticsStatus.Uploaded,
+              }
             );
             if (ftpClient) {
               ftpClient.close();
@@ -856,8 +868,11 @@ export default class OCPP16IncomingRequestService extends OCPPIncomingRequestSer
           OCPP16IncomingRequestCommand.GET_DIAGNOSTICS
         );
       } catch (error) {
-        await this.chargingStation.ocppRequestService.sendDiagnosticsStatusNotification(
-          OCPP16DiagnosticsStatus.UploadFailed
+        await this.chargingStation.ocppRequestService.sendMessageHandler(
+          OCPP16RequestCommand.DIAGNOSTICS_STATUS_NOTIFICATION,
+          {
+            status: OCPP16DiagnosticsStatus.UploadFailed,
+          }
         );
         if (ftpClient) {
           ftpClient.close();
@@ -874,8 +889,11 @@ export default class OCPP16IncomingRequestService extends OCPPIncomingRequestSer
           uri.protocol
         } to transfer the diagnostic logs archive`
       );
-      await this.chargingStation.ocppRequestService.sendDiagnosticsStatusNotification(
-        OCPP16DiagnosticsStatus.UploadFailed
+      await this.chargingStation.ocppRequestService.sendMessageHandler(
+        OCPP16RequestCommand.DIAGNOSTICS_STATUS_NOTIFICATION,
+        {
+          status: OCPP16DiagnosticsStatus.UploadFailed,
+        }
       );
       return Constants.OCPP_RESPONSE_EMPTY;
     }