From d39adbd45dfc5fe4a42d64b93d229cfdfad878a9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Fri, 27 Jun 2025 16:21:48 +0200 Subject: [PATCH] fix: check vendorId against CS template at DataTransfer cmd handling (#1450) MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit Co-authored-by: Jérôme Benoit --- src/charging-station/ocpp/1.6/OCPP16IncomingRequestService.ts | 3 +-- src/types/index.ts | 1 - src/types/ocpp/1.6/Requests.ts | 2 -- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/charging-station/ocpp/1.6/OCPP16IncomingRequestService.ts b/src/charging-station/ocpp/1.6/OCPP16IncomingRequestService.ts index b3d58eae..7c0afb28 100644 --- a/src/charging-station/ocpp/1.6/OCPP16IncomingRequestService.ts +++ b/src/charging-station/ocpp/1.6/OCPP16IncomingRequestService.ts @@ -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 diff --git a/src/types/index.ts b/src/types/index.ts index 63b1cdee..d603d0ad 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -92,7 +92,6 @@ export { type OCPP16ClearCacheRequest, type OCPP16ClearChargingProfileRequest, type OCPP16DataTransferRequest, - OCPP16DataTransferVendorId, type OCPP16DiagnosticsStatusNotificationRequest, OCPP16FirmwareStatus, type OCPP16FirmwareStatusNotificationRequest, diff --git a/src/types/ocpp/1.6/Requests.ts b/src/types/ocpp/1.6/Requests.ts index 44327c8b..e4283183 100644 --- a/src/types/ocpp/1.6/Requests.ts +++ b/src/types/ocpp/1.6/Requests.ts @@ -15,8 +15,6 @@ export enum OCPP16AvailabilityType { Operative = 'Operative', } -export enum OCPP16DataTransferVendorId {} - export enum OCPP16FirmwareStatus { Downloaded = 'Downloaded', DownloadFailed = 'DownloadFailed', -- 2.43.0