type HeartbeatRequest,
type MeterValuesRequest,
RequestCommand,
+ RequestParams,
type StatusNotificationRequest,
} from '../types/ocpp/Requests';
import {
constructor(chargingStation: ChargingStation) {
super();
+ const requestParams: RequestParams = {
+ throwError: true,
+ };
this.commandHandlers = new Map<BroadcastChannelProcedureName, CommandHandler>([
[BroadcastChannelProcedureName.START_CHARGING_STATION, () => this.chargingStation.start()],
[
this.chargingStation.ocppRequestService.requestHandler<
StartTransactionRequest,
StartTransactionResponse
- >(this.chargingStation, RequestCommand.START_TRANSACTION, requestPayload),
+ >(this.chargingStation, RequestCommand.START_TRANSACTION, requestPayload, requestParams),
],
[
BroadcastChannelProcedureName.STOP_TRANSACTION,
true
),
...requestPayload,
+ requestParams,
}),
],
[
this.chargingStation.ocppRequestService.requestHandler<
AuthorizeRequest,
AuthorizeResponse
- >(this.chargingStation, RequestCommand.AUTHORIZE, requestPayload),
+ >(this.chargingStation, RequestCommand.AUTHORIZE, requestPayload, requestParams),
],
[
BroadcastChannelProcedureName.BOOT_NOTIFICATION,
},
{
skipBufferingOnError: true,
+ throwError: true,
}
);
return this.chargingStation.bootNotificationResponse;
this.chargingStation.ocppRequestService.requestHandler<
StatusNotificationRequest,
StatusNotificationResponse
- >(this.chargingStation, RequestCommand.STATUS_NOTIFICATION, requestPayload),
+ >(
+ this.chargingStation,
+ RequestCommand.STATUS_NOTIFICATION,
+ requestPayload,
+ requestParams
+ ),
],
[
BroadcastChannelProcedureName.HEARTBEAT,
this.chargingStation.ocppRequestService.requestHandler<
HeartbeatRequest,
HeartbeatResponse
- >(this.chargingStation, RequestCommand.HEARTBEAT, requestPayload),
+ >(this.chargingStation, RequestCommand.HEARTBEAT, requestPayload, requestParams),
],
[
BroadcastChannelProcedureName.METER_VALUES,
),
],
...requestPayload,
+ requestParams,
});
},
],
this.chargingStation.ocppRequestService.requestHandler<
DataTransferRequest,
DataTransferResponse
- >(this.chargingStation, RequestCommand.DATA_TRANSFER, requestPayload),
+ >(this.chargingStation, RequestCommand.DATA_TRANSFER, requestPayload, requestParams),
],
[
BroadcastChannelProcedureName.DIAGNOSTICS_STATUS_NOTIFICATION,
this.chargingStation.ocppRequestService.requestHandler<
DiagnosticsStatusNotificationRequest,
DiagnosticsStatusNotificationResponse
- >(this.chargingStation, RequestCommand.DIAGNOSTICS_STATUS_NOTIFICATION, requestPayload),
+ >(
+ this.chargingStation,
+ RequestCommand.DIAGNOSTICS_STATUS_NOTIFICATION,
+ requestPayload,
+ requestParams
+ ),
],
[
BroadcastChannelProcedureName.FIRMWARE_STATUS_NOTIFICATION,
this.chargingStation.ocppRequestService.requestHandler<
FirmwareStatusNotificationRequest,
FirmwareStatusNotificationResponse
- >(this.chargingStation, RequestCommand.FIRMWARE_STATUS_NOTIFICATION, requestPayload),
+ >(
+ this.chargingStation,
+ RequestCommand.FIRMWARE_STATUS_NOTIFICATION,
+ requestPayload,
+ requestParams
+ ),
],
]);
this.chargingStation = chargingStation;