// Send BootNotification
let registrationRetryCount = 0;
do {
- this.bootNotificationResponse = await this.ocppRequestService.sendBootNotification(
- this.bootNotificationRequest.chargePointModel,
- this.bootNotificationRequest.chargePointVendor,
- this.bootNotificationRequest.chargeBoxSerialNumber,
- this.bootNotificationRequest.firmwareVersion
- );
+ this.bootNotificationResponse = (await this.ocppRequestService.sendMessageHandler(
+ RequestCommand.BOOT_NOTIFICATION,
+ {
+ chargePointModel: this.bootNotificationRequest.chargePointModel,
+ chargePointVendor: this.bootNotificationRequest.chargePointVendor,
+ chargeBoxSerialNumber: this.bootNotificationRequest.chargeBoxSerialNumber,
+ firmwareVersion: this.bootNotificationRequest.firmwareVersion,
+ },
+ { skipBufferingOnError: true }
+ )) as BootNotificationResponse;
if (!this.isInAcceptedState()) {
this.getRegistrationMaxRetries() !== -1 && registrationRetryCount++;
await Utils.sleep(
private async startMessageSequence(): Promise<void> {
if (this.stationInfo.autoRegister) {
- await this.ocppRequestService.sendBootNotification(
- this.bootNotificationRequest.chargePointModel,
- this.bootNotificationRequest.chargePointVendor,
- this.bootNotificationRequest.chargeBoxSerialNumber,
- this.bootNotificationRequest.firmwareVersion
+ await this.ocppRequestService.sendMessageHandler(
+ RequestCommand.BOOT_NOTIFICATION,
+ {
+ chargePointModel: this.bootNotificationRequest.chargePointModel,
+ chargePointVendor: this.bootNotificationRequest.chargePointVendor,
+ chargeBoxSerialNumber: this.bootNotificationRequest.chargeBoxSerialNumber,
+ firmwareVersion: this.bootNotificationRequest.firmwareVersion,
+ },
+ { skipBufferingOnError: true }
);
}
// Start WebSocket ping
case MessageTrigger.BootNotification:
setTimeout(() => {
this.chargingStation.ocppRequestService
- .sendBootNotification(
- this.chargingStation.getBootNotificationRequest().chargePointModel,
- this.chargingStation.getBootNotificationRequest().chargePointVendor,
- this.chargingStation.getBootNotificationRequest().chargeBoxSerialNumber,
- this.chargingStation.getBootNotificationRequest().firmwareVersion,
- this.chargingStation.getBootNotificationRequest().chargePointSerialNumber,
- this.chargingStation.getBootNotificationRequest().iccid,
- this.chargingStation.getBootNotificationRequest().imsi,
- this.chargingStation.getBootNotificationRequest().meterSerialNumber,
- this.chargingStation.getBootNotificationRequest().meterType,
- { triggerMessage: true }
+ .sendMessageHandler(
+ OCPP16RequestCommand.BOOT_NOTIFICATION,
+ {
+ chargePointModel:
+ this.chargingStation.getBootNotificationRequest().chargePointModel,
+ chargePointVendor:
+ this.chargingStation.getBootNotificationRequest().chargePointVendor,
+ chargeBoxSerialNumber:
+ this.chargingStation.getBootNotificationRequest().chargeBoxSerialNumber,
+ firmwareVersion:
+ this.chargingStation.getBootNotificationRequest().firmwareVersion,
+ chargePointSerialNumber:
+ this.chargingStation.getBootNotificationRequest().chargePointSerialNumber,
+ iccid: this.chargingStation.getBootNotificationRequest().iccid,
+ imsi: this.chargingStation.getBootNotificationRequest().imsi,
+ meterSerialNumber:
+ this.chargingStation.getBootNotificationRequest().meterSerialNumber,
+ meterType: this.chargingStation.getBootNotificationRequest().meterType,
+ },
+ { skipBufferingOnError: true, triggerMessage: true }
)
.catch(() => {
/* This is intentional */
import Constants from '../../../utils/Constants';
import { ErrorType } from '../../../types/ocpp/ErrorType';
import { JsonType } from '../../../types/JsonType';
-import { OCPP16BootNotificationResponse } from '../../../types/ocpp/1.6/Responses';
import { OCPP16ChargePointErrorCode } from '../../../types/ocpp/1.6/ChargePointErrorCode';
import { OCPP16ChargePointStatus } from '../../../types/ocpp/1.6/ChargePointStatus';
import { OCPP16DiagnosticsStatus } from '../../../types/ocpp/1.6/DiagnosticsStatus';
);
}
- public async sendBootNotification(
- chargePointModel: string,
- chargePointVendor: string,
- chargeBoxSerialNumber?: string,
- firmwareVersion?: string,
- chargePointSerialNumber?: string,
- iccid?: string,
- imsi?: string,
- meterSerialNumber?: string,
- meterType?: string,
- params?: SendParams
- ): Promise<OCPP16BootNotificationResponse> {
- const payload: OCPP16BootNotificationRequest = {
- chargePointModel,
- chargePointVendor,
- ...(!Utils.isUndefined(chargeBoxSerialNumber) && { chargeBoxSerialNumber }),
- ...(!Utils.isUndefined(chargePointSerialNumber) && { chargePointSerialNumber }),
- ...(!Utils.isUndefined(firmwareVersion) && { firmwareVersion }),
- ...(!Utils.isUndefined(iccid) && { iccid }),
- ...(!Utils.isUndefined(imsi) && { imsi }),
- ...(!Utils.isUndefined(meterSerialNumber) && { meterSerialNumber }),
- ...(!Utils.isUndefined(meterType) && { meterType }),
- };
- return (await this.sendMessage(
- Utils.generateUUID(),
- payload,
- OCPP16RequestCommand.BOOT_NOTIFICATION,
- { ...params, skipBufferingOnError: true }
- )) as OCPP16BootNotificationResponse;
- }
-
public async sendStatusNotification(
connectorId: number,
status: OCPP16ChargePointStatus,
params?: SendParams
): Promise<ResponseType>;
- public abstract sendBootNotification(
- chargePointModel: string,
- chargePointVendor: string,
- chargeBoxSerialNumber?: string,
- firmwareVersion?: string,
- chargePointSerialNumber?: string,
- iccid?: string,
- imsi?: string,
- meterSerialNumber?: string,
- meterType?: string,
- params?: SendParams
- ): Promise<BootNotificationResponse>;
-
public abstract sendStatusNotification(
connectorId: number,
status: ChargePointStatus,