import OCPP16IncomingRequestService from './ocpp/1.6/OCPP16IncomingRequestService';
import OCPP16RequestService from './ocpp/1.6/OCPP16RequestService';
import OCPP16ResponseService from './ocpp/1.6/OCPP16ResponseService';
-import OCPPError from './ocpp/OCPPError';
+import OCPPError from '../exception/OCPPError';
import OCPPIncomingRequestService from './ocpp/OCPPIncomingRequestService';
import OCPPRequestService from './ocpp/OCPPRequestService';
import { OCPPVersion } from '../types/ocpp/OCPPVersion';
}
public isWebSocketConnectionOpened(): boolean {
- return this.wsConnection?.readyState === OPEN;
+ return this?.wsConnection?.readyState === OPEN;
}
public isRegistered(): boolean {
- return this.bootNotificationResponse?.status === RegistrationStatus.ACCEPTED;
+ return this?.bootNotificationResponse?.status === RegistrationStatus.ACCEPTED;
}
public isChargingStationAvailable(): boolean {
}
} while (!this.isRegistered() && (registrationRetryCount <= this.getRegistrationMaxRetries() || this.getRegistrationMaxRetries() === -1));
}
+ if (this.isRegistered() && this.stationInfo.autoRegister) {
+ await this.ocppRequestService.sendBootNotification(this.bootNotificationRequest.chargePointModel,
+ this.bootNotificationRequest.chargePointVendor, this.bootNotificationRequest.chargeBoxSerialNumber, this.bootNotificationRequest.firmwareVersion);
+ }
if (this.isRegistered()) {
await this.startMessageSequence();
this.stopped && (this.stopped = false);
}
private getMaxNumberOfConnectors(): number {
- let maxConnectors = 0;
+ let maxConnectors: number;
if (!Utils.isEmptyArray(this.stationInfo.numberOfConnectors)) {
const numberOfConnectors = this.stationInfo.numberOfConnectors as number[];
// Distribute evenly the number of connectors