Merge branch 'main' into reservation-feature
authorJérôme Benoit <jerome.benoit@sap.com>
Mon, 5 Jun 2023 15:36:45 +0000 (17:36 +0200)
committerGitHub <noreply@github.com>
Mon, 5 Jun 2023 15:36:45 +0000 (17:36 +0200)
1  2 
README.md
src/charging-station/ChargingStation.ts
src/charging-station/ocpp/1.6/OCPP16IncomingRequestService.ts
src/charging-station/ocpp/1.6/OCPP16ResponseService.ts
src/charging-station/ocpp/OCPPConstants.ts

diff --cc README.md
Simple merge
index 82ed3b8c0da8ad579e767e6695010352a66b1343,9a8f468b37bee455378b890a2392a4e02a9dfefb..a3f6769607c5b01bb9774bf614a71f31a80a5afe
@@@ -67,11 -67,9 +67,12 @@@ import 
    PowerUnits,
    RegistrationStatusEnumType,
    RequestCommand,
 +  type Reservation,
 +  ReservationFilterKey,
 +  ReservationTerminationReason,
    type Response,
    StandardParametersKey,
+   type Status,
    type StatusNotificationRequest,
    type StatusNotificationResponse,
    StopTransactionReason,
@@@ -650,12 -645,9 +653,12 @@@ export class ChargingStation 
          if (this.getEnableStatistics() === true) {
            this.performanceStatistics?.start();
          }
 +        if (this.hasFeatureProfile(SupportedFeatureProfiles.Reservation)) {
 +          this.startReservationExpiryDateSetInterval();
 +        }
          this.openWSConnection();
          // Monitor charging station template file
-         this.templateFileWatcher = FileUtils.watchJsonFile(
+         this.templateFileWatcher = watchJsonFile(
            this.templateFile,
            FileType.ChargingStationTemplate,
            this.logPrefix(),
      return this.stationInfo?.stationInfoPersistentConfiguration ?? true;
    }
  
+   private getAutomaticTransactionGeneratorPersistentConfiguration(): boolean {
+     return this.stationInfo?.automaticTransactionGeneratorPersistentConfiguration ?? true;
+   }
    private handleUnsupportedVersion(version: OCPPVersion) {
 -    const errorMsg = `Unsupported protocol version '${version}' configured in template file ${this.templateFile}`;
 +    const errorMsg = `Unsupported protocol version '${version}' configured
 +      in template file ${this.templateFile}`;
      logger.error(`${this.logPrefix()} ${errorMsg}`);
      throw new BaseError(errorMsg);
    }
index 2d2a34a0a22a25afc95c8e2fd8fb7b5f6e46a3d2,e82b7d70a6704110df3950baeb059e01df9ce28a..b3f4dd3208315681d616f10cacfafa8bfb29ea77
@@@ -101,35 -104,11 +105,39 @@@ export class OCPPConstants 
    static readonly OCPP_DATA_TRANSFER_RESPONSE_REJECTED = Object.freeze({
      status: DataTransferStatus.REJECTED,
    });
 -
++  
+   static readonly OCPP_DATA_TRANSFER_RESPONSE_UNKNOWN_VENDOR_ID = Object.freeze({
+     status: DataTransferStatus.UNKNOWN_VENDOR_ID,
+   });
  
 +  static readonly OCPP_RESERVATION_RESPONSE_ACCEPTED = Object.freeze({
 +    status: ReservationStatus.ACCEPTED,
 +  }); // Reservation has been made
 +
 +  static readonly OCPP_RESERVATION_RESPONSE_FAULTED = Object.freeze({
 +    status: ReservationStatus.FAULTED,
 +  }); // Reservation has not been made, because of connector in FAULTED state
 +
 +  static readonly OCPP_RESERVATION_RESPONSE_OCCUPIED = Object.freeze({
 +    status: ReservationStatus.OCCUPIED,
 +  }); // Reservation has not been made, because all connectors are OCCUPIED
 +
 +  static readonly OCPP_RESERVATION_RESPONSE_REJECTED = Object.freeze({
 +    status: ReservationStatus.REJECTED,
 +  }); // Reservation has not been made, because CS is not configured to accept reservations
 +
 +  static readonly OCPP_RESERVATION_RESPONSE_UNAVAILABLE = Object.freeze({
 +    status: ReservationStatus.UNAVAILABLE,
 +  }); // Reservation has not been made, because connectors are spec. connector is in UNAVAILABLE state
 +
 +  static readonly OCPP_CANCEL_RESERVATION_RESPONSE_ACCEPTED = Object.freeze({
 +    status: GenericStatus.Accepted,
 +  }); // Reservation for id has been cancelled has been made
 +
 +  static readonly OCPP_CANCEL_RESERVATION_RESPONSE_REJECTED = Object.freeze({
 +    status: GenericStatus.Rejected,
 +  }); // Reservation could not be cancelled, because there is no reservation active for id
 +
    protected constructor() {
      // This is intentional
    }