]> Piment Noir Git Repositories - e-mobility-charging-stations-simulator.git/commitdiff
fix(ocpp20): send TransactionEvent(Started) on RequestStartTransaction (E02.FR.01)
authorJérôme Benoit <jerome.benoit@sap.com>
Mon, 16 Mar 2026 14:58:06 +0000 (15:58 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Mon, 16 Mar 2026 14:58:06 +0000 (15:58 +0100)
The handler accepted remote start transactions without notifying the
CSMS via TransactionEvent. Per E02.FR.01, the CS SHALL send
TransactionEvent with eventType=Started when a transaction begins.

Also starts meter values interval for the new transaction.

src/charging-station/ocpp/2.0/OCPP20IncomingRequestService.ts

index 3ddaef2dacbbd192d31b694380903b5c02619c08..41281ec2e490541cffc2748df0319d0256b98b99 100644 (file)
@@ -98,8 +98,10 @@ import {
   type OCPP20SetVariablesResponse,
   type OCPP20StatusNotificationRequest,
   type OCPP20StatusNotificationResponse,
+  OCPP20TransactionEventEnumType,
   type OCPP20TriggerMessageRequest,
   type OCPP20TriggerMessageResponse,
+  OCPP20TriggerReasonEnumType,
   type OCPP20UnlockConnectorRequest,
   type OCPP20UnlockConnectorResponse,
   type OCPP20UpdateFirmwareRequest,
@@ -2417,6 +2419,18 @@ export class OCPP20IncomingRequestService extends OCPPIncomingRequestService {
         evseId
       )
 
+      // E02.FR.01: Send TransactionEvent(Started) to CSMS
+      await OCPP20ServiceUtils.sendTransactionEvent(
+        chargingStation,
+        OCPP20TransactionEventEnumType.Started,
+        OCPP20TriggerReasonEnumType.RemoteStart,
+        connectorId,
+        transactionId
+      )
+
+      const txUpdatedInterval = this.getTxUpdatedInterval(chargingStation)
+      chargingStation.startTxUpdatedInterval(connectorId, txUpdatedInterval)
+
       if (chargingProfile != null) {
         connectorStatus.chargingProfiles ??= []
         connectorStatus.chargingProfiles.push(chargingProfile)