X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fcharging-station%2Focpp%2F1.6%2FOCPP16RequestService.ts;h=5c1c129f6b671a96d22207f8aa4c6620a88ab7d1;hb=c4ab56bac3353a08b0b7e058e9edfcfc0e629c94;hp=ac1c1ac30d8810ac85e00de9b94b438e4e9876a0;hpb=e1d9a0f4d6ff1a90048e9a694fd12b7031cc6961;p=e-mobility-charging-stations-simulator.git diff --git a/src/charging-station/ocpp/1.6/OCPP16RequestService.ts b/src/charging-station/ocpp/1.6/OCPP16RequestService.ts index ac1c1ac3..5c1c129f 100644 --- a/src/charging-station/ocpp/1.6/OCPP16RequestService.ts +++ b/src/charging-station/ocpp/1.6/OCPP16RequestService.ts @@ -12,6 +12,7 @@ import { type JsonType, type OCPP16AuthorizeRequest, type OCPP16BootNotificationRequest, + OCPP16ChargePointStatus, type OCPP16DataTransferRequest, type OCPP16DiagnosticsStatusNotificationRequest, type OCPP16FirmwareStatusNotificationRequest, @@ -183,6 +184,18 @@ export class OCPP16RequestService extends OCPPRequestService { true, ), timestamp: new Date(), + ...(OCPP16ServiceUtils.hasReservation( + chargingStation, + commandParams?.connectorId as number, + commandParams?.idTag as string, + ) && { + reservationId: chargingStation.getReservationBy( + 'connectorId', + chargingStation.getConnectorStatus(0)?.status === OCPP16ChargePointStatus.Reserved + ? 0 + : (commandParams?.connectorId as number), + )!.reservationId, + }), ...commandParams, } as unknown as Request; case OCPP16RequestCommand.STOP_TRANSACTION: