X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fcharging-station%2Focpp%2FOCPPConstants.ts;h=b8448fb63de6539d941646555dfbce427a8b0d30;hb=0ed4ca0a1bd55fddf3c219e8cca11ca6d7f33b54;hp=2da9345563936f545fef5089abd373bc00ebd2a3;hpb=4ecff7ce6e87af51f1ff04e95641aee2270fbdb0;p=e-mobility-charging-stations-simulator.git diff --git a/src/charging-station/ocpp/OCPPConstants.ts b/src/charging-station/ocpp/OCPPConstants.ts index 2da93455..b8448fb6 100644 --- a/src/charging-station/ocpp/OCPPConstants.ts +++ b/src/charging-station/ocpp/OCPPConstants.ts @@ -5,12 +5,25 @@ import { ConfigurationStatus, DataTransferStatus, GenericStatus, + MeterValueMeasurand, TriggerMessageStatus, UnlockStatus, } from '../../types'; +import { CancelReservationStatus, ReservationStatus } from '../../types/ocpp/Responses'; import { Constants } from '../../utils'; export class OCPPConstants { + static readonly OCPP_WEBSOCKET_TIMEOUT = 60000; // Ms + static readonly OCPP_TRIGGER_MESSAGE_DELAY = 500; // Ms + + static readonly OCPP_MEASURANDS_SUPPORTED = Object.freeze([ + MeterValueMeasurand.STATE_OF_CHARGE, + MeterValueMeasurand.VOLTAGE, + MeterValueMeasurand.POWER_ACTIVE_IMPORT, + MeterValueMeasurand.CURRENT_IMPORT, + MeterValueMeasurand.ENERGY_ACTIVE_IMPORT_REGISTER, + ]); + static readonly OCPP_REQUEST_EMPTY = Constants.EMPTY_FREEZED_OBJECT; static readonly OCPP_RESPONSE_EMPTY = Constants.EMPTY_FREEZED_OBJECT; static readonly OCPP_RESPONSE_ACCEPTED = Object.freeze({ status: GenericStatus.Accepted }); @@ -89,6 +102,18 @@ export class OCPPConstants { status: DataTransferStatus.REJECTED, }); + 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: CancelReservationStatus.ACCEPTED }); // Reservation for id has been cancelled has been made + static readonly OCPP_CANCEL_RESERVATION_RESPONSE_REJECTED = Object.freeze({ status: CancelReservationStatus.REJECTED }); // Reservation could not be cancelled, because there is no reservation active for id + + static readonly OCPP_SUPPORTED_FEATURE_PROFILE_RESERVATION = 'Reservation'; + static readonly OCPP_RESERVE_CONNECTOR_ZERO_SUPPORTED = 'ReserveConnectorZeroSupported'; + protected constructor() { // This is intentional }