public addToMessageQueue(message: string): void {
let dups = false;
- // Handle dups in buffer
+ // Handle dups in message queue
for (const bufferedMessage of this.messageQueue) {
- // Same message
+ // Message already in the queue
if (message === bufferedMessage) {
dups = true;
break;
}
}
if (!dups) {
- // Buffer message
+ // Queue message
this.messageQueue.push(message);
}
}
// 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.sendBootNotification(this.bootNotificationRequest.chargePointModel,
+ this.bootNotificationRequest.chargePointVendor, this.bootNotificationRequest.chargeBoxSerialNumber, this.bootNotificationRequest.firmwareVersion);
if (!this.isRegistered()) {
registrationRetryCount++;
await Utils.sleep(this.bootNotificationResponse?.interval ? this.bootNotificationResponse.interval * 1000 : Constants.OCPP_DEFAULT_BOOT_NOTIFICATION_INTERVAL);
}
private getAuthorizationFile(): string {
- return this.stationInfo.authorizationFile && path.join(path.resolve(__dirname, '../'), 'assets', this.stationInfo.authorizationFile);
+ return this.stationInfo.authorizationFile && path.join(path.resolve(__dirname, '../'), 'assets', path.basename(this.stationInfo.authorizationFile));
}
private getAuthorizedTags(): string[] {