From: Jérôme Benoit Date: Tue, 8 Mar 2022 10:52:55 +0000 (+0100) Subject: Convert sendTransactionBeginMeterValues to OCPP message sending handler X-Git-Tag: v1.1.52~7 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=443c064190213667582c916489760732147c48aa;p=e-mobility-charging-stations-simulator.git Convert sendTransactionBeginMeterValues to OCPP message sending handler Signed-off-by: Jérôme Benoit --- diff --git a/src/charging-station/ocpp/1.6/OCPP16RequestService.ts b/src/charging-station/ocpp/1.6/OCPP16RequestService.ts index 87d77104..acc7fd2e 100644 --- a/src/charging-station/ocpp/1.6/OCPP16RequestService.ts +++ b/src/charging-station/ocpp/1.6/OCPP16RequestService.ts @@ -57,19 +57,6 @@ export default class OCPP16RequestService extends OCPPRequestService { ); } - public async sendTransactionBeginMeterValues( - connectorId: number, - transactionId: number, - beginMeterValue: OCPP16MeterValue - ): Promise { - const payload: MeterValuesRequest = { - connectorId, - transactionId, - meterValue: [beginMeterValue], - }; - await this.sendMessage(Utils.generateUUID(), payload, OCPP16RequestCommand.METER_VALUES); - } - public async sendTransactionEndMeterValues( connectorId: number, transactionId: number, diff --git a/src/charging-station/ocpp/1.6/OCPP16ResponseService.ts b/src/charging-station/ocpp/1.6/OCPP16ResponseService.ts index 759f3705..e4cc057c 100644 --- a/src/charging-station/ocpp/1.6/OCPP16ResponseService.ts +++ b/src/charging-station/ocpp/1.6/OCPP16ResponseService.ts @@ -310,10 +310,14 @@ export default class OCPP16ResponseService extends OCPPResponseService { requestPayload.meterStart ); this.chargingStation.getBeginEndMeterValues() && - (await this.chargingStation.ocppRequestService.sendTransactionBeginMeterValues( - connectorId, - payload.transactionId, - this.chargingStation.getConnectorStatus(connectorId).transactionBeginMeterValue + (await this.chargingStation.ocppRequestService.sendMessageHandler( + OCPP16RequestCommand.METER_VALUES, + { + connectorId, + transactionId: payload.transactionId, + meterValue: + this.chargingStation.getConnectorStatus(connectorId).transactionBeginMeterValue, + } )); await this.chargingStation.ocppRequestService.sendMessageHandler( OCPP16RequestCommand.STATUS_NOTIFICATION, diff --git a/src/charging-station/ocpp/OCPPRequestService.ts b/src/charging-station/ocpp/OCPPRequestService.ts index dc5bf9b5..3be275f1 100644 --- a/src/charging-station/ocpp/OCPPRequestService.ts +++ b/src/charging-station/ocpp/OCPPRequestService.ts @@ -324,12 +324,6 @@ export default abstract class OCPPRequestService { params?: SendParams ): Promise; - public abstract sendTransactionBeginMeterValues( - connectorId: number, - transactionId: number, - beginMeterValue: MeterValue - ): Promise; - public abstract sendTransactionEndMeterValues( connectorId: number, transactionId: number,