X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fcharging-station%2Focpp%2F1.6%2FOCPP16IncomingRequestService.ts;h=754d0fbfc5cbd0d22beb95ef126a2106a58c68db;hb=b03df580733c540eafc26269ee267b675e6b4ae8;hp=ebec27d23544cd40f741b7429042464534fdaf9f;hpb=b1340ec1468911ac6d199013e4d382f2975f453c;p=e-mobility-charging-stations-simulator.git diff --git a/src/charging-station/ocpp/1.6/OCPP16IncomingRequestService.ts b/src/charging-station/ocpp/1.6/OCPP16IncomingRequestService.ts index ebec27d2..754d0fbf 100644 --- a/src/charging-station/ocpp/1.6/OCPP16IncomingRequestService.ts +++ b/src/charging-station/ocpp/1.6/OCPP16IncomingRequestService.ts @@ -39,6 +39,7 @@ import { OCPP16RequestCommand, OCPP16StatusNotificationRequest, OCPP16TriggerMessageRequest, + OCPP16UpdateFirmwareRequest, RemoteStartTransactionRequest, RemoteStopTransactionRequest, ResetRequest, @@ -58,6 +59,7 @@ import { OCPP16HeartbeatResponse, OCPP16StatusNotificationResponse, OCPP16TriggerMessageResponse, + OCPP16UpdateFirmwareResponse, SetChargingProfileResponse, UnlockConnectorResponse, } from '../../../types/ocpp/1.6/Responses'; @@ -128,6 +130,7 @@ export default class OCPP16IncomingRequestService extends OCPPIncomingRequestSer [OCPP16IncomingRequestCommand.GET_DIAGNOSTICS, this.handleRequestGetDiagnostics.bind(this)], [OCPP16IncomingRequestCommand.TRIGGER_MESSAGE, this.handleRequestTriggerMessage.bind(this)], [OCPP16IncomingRequestCommand.DATA_TRANSFER, this.handleRequestDataTransfer.bind(this)], + // [OCPP16IncomingRequestCommand.UPDATE_FIRMWARE, this.handleRequestUpdateFirmware.bind(this)], ]); this.jsonSchemas = new Map>([ [ @@ -1006,6 +1009,28 @@ export default class OCPP16IncomingRequestService extends OCPPIncomingRequestSer return Constants.OCPP_RESPONSE_REJECTED; } + private handleRequestUpdateFirmware( + chargingStation: ChargingStation, + commandPayload: OCPP16UpdateFirmwareRequest + ): OCPP16UpdateFirmwareResponse { + if ( + OCPP16ServiceUtils.checkFeatureProfile( + chargingStation, + OCPP16SupportedFeatureProfiles.FirmwareManagement, + OCPP16IncomingRequestCommand.UPDATE_FIRMWARE + ) === false + ) { + return Constants.OCPP_RESPONSE_EMPTY; + } + logger.debug( + chargingStation.logPrefix() + + ' ' + + OCPP16IncomingRequestCommand.UPDATE_FIRMWARE + + ' request received: %j', + commandPayload + ); + } + private async handleRequestGetDiagnostics( chargingStation: ChargingStation, commandPayload: GetDiagnosticsRequest