]> Piment Noir Git Repositories - e-mobility-charging-stations-simulator.git/commitdiff
fix: check vendorId against CS template at DataTransfer cmd handling (#1450)
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Fri, 27 Jun 2025 14:21:48 +0000 (16:21 +0200)
committerGitHub <noreply@github.com>
Fri, 27 Jun 2025 14:21:48 +0000 (16:21 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
Co-authored-by: Jérôme Benoit <jerome.benoit@sap.com>
src/charging-station/ocpp/1.6/OCPP16IncomingRequestService.ts
src/types/index.ts
src/types/ocpp/1.6/Requests.ts

index b3d58eaeb18ee576c2743e1524e631e30639e90e..7c0afb283aabf5f24336948b5bd3088220f024bb 100644 (file)
@@ -60,7 +60,6 @@ import {
   type OCPP16ClearChargingProfileResponse,
   type OCPP16DataTransferRequest,
   type OCPP16DataTransferResponse,
-  OCPP16DataTransferVendorId,
   OCPP16DiagnosticsStatus,
   type OCPP16DiagnosticsStatusNotificationRequest,
   type OCPP16DiagnosticsStatusNotificationResponse,
@@ -904,7 +903,7 @@ export class OCPP16IncomingRequestService extends OCPPIncomingRequestService {
   ): OCPP16DataTransferResponse {
     const { vendorId } = commandPayload
     try {
-      if (Object.values(OCPP16DataTransferVendorId).includes(vendorId)) {
+      if (vendorId === chargingStation.stationInfo?.chargePointVendor) {
         return OCPP16Constants.OCPP_DATA_TRANSFER_RESPONSE_ACCEPTED
       }
       return OCPP16Constants.OCPP_DATA_TRANSFER_RESPONSE_UNKNOWN_VENDOR_ID
index 63b1cdeea44bc5daa50d4a355924e75167685908..d603d0adc360964b80146ef1d1c3d88ff3fd3822 100644 (file)
@@ -92,7 +92,6 @@ export {
   type OCPP16ClearCacheRequest,
   type OCPP16ClearChargingProfileRequest,
   type OCPP16DataTransferRequest,
-  OCPP16DataTransferVendorId,
   type OCPP16DiagnosticsStatusNotificationRequest,
   OCPP16FirmwareStatus,
   type OCPP16FirmwareStatusNotificationRequest,
index 44327c8b47f622566612b3621f0f7fadd4954fdb..e4283183b7455e9b27cedbefd4cd494022fbe96d 100644 (file)
@@ -15,8 +15,6 @@ export enum OCPP16AvailabilityType {
   Operative = 'Operative',
 }
 
-export enum OCPP16DataTransferVendorId {}
-
 export enum OCPP16FirmwareStatus {
   Downloaded = 'Downloaded',
   DownloadFailed = 'DownloadFailed',