+
+ private handleRequestTriggerMessage(commandPayload: OCPP16TriggerMessageRequest): OCPP16TriggerMessageResponse {
+ try {
+ switch (commandPayload.requestedMessage) {
+ case MessageTrigger.BootNotification:
+ setTimeout(() => {
+ this.chargingStation.ocppRequestService.sendBootNotification(this.chargingStation.getBootNotificationRequest().chargePointModel,
+ this.chargingStation.getBootNotificationRequest().chargePointVendor, this.chargingStation.getBootNotificationRequest().chargeBoxSerialNumber,
+ this.chargingStation.getBootNotificationRequest().firmwareVersion).catch(() => {});
+ }, Constants.OCPP_TRIGGER_MESSAGE_DELAY);
+ return Constants.OCPP_TRIGGER_MESSAGE_RESPONSE_ACCEPTED;
+ case MessageTrigger.Heartbeat:
+ setTimeout(() => {
+ this.chargingStation.ocppRequestService.sendHeartbeat().catch(() => {});
+ }, Constants.OCPP_TRIGGER_MESSAGE_DELAY);
+ return Constants.OCPP_TRIGGER_MESSAGE_RESPONSE_ACCEPTED;
+ default:
+ return Constants.OCPP_TRIGGER_MESSAGE_RESPONSE_NOT_IMPLEMENTED;
+ }
+ } catch (error) {
+ return this.handleIncomingRequestError(IncomingRequestCommand.TRIGGER_MESSAGE, error, Constants.OCPP_TRIGGER_MESSAGE_RESPONSE_REJECTED) as OCPP16TriggerMessageResponse;
+ }
+ }