Update dependencies.
[e-mobility-charging-stations-simulator.git] / src / charging-station / ChargingStation.ts
index 316b280e6629d20c4b26a6c50f49048a38f43691..b5ec5209ad8a56a2aa713a08de0a50da529b881e 100644 (file)
@@ -322,16 +322,16 @@ export default class ChargingStation {
 
   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);
     }
   }
@@ -480,7 +480,8 @@ export default class ChargingStation {
       // 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);
@@ -599,7 +600,7 @@ export default class ChargingStation {
   }
 
   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[] {