X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fcharging-station%2Focpp%2FOCPPConstants.ts;h=dbe7834b4e0e6fbdddab7d77501dc32a9470e85a;hb=1a6188b2fcd2bf644e6fea0c697a095228c1aed0;hp=5a271f5902f2a8f36e39d42cbdd407b32be97498;hpb=c3da35d496cbb2c78e85fb3d2e125ffd6fd297f4;p=e-mobility-charging-stations-simulator.git diff --git a/src/charging-station/ocpp/OCPPConstants.ts b/src/charging-station/ocpp/OCPPConstants.ts index 5a271f59..dbe7834b 100644 --- a/src/charging-station/ocpp/OCPPConstants.ts +++ b/src/charging-station/ocpp/OCPPConstants.ts @@ -9,6 +9,7 @@ import { TriggerMessageStatus, UnlockStatus, } from '../../types'; +import { ReservationStatus } from '../../types/ocpp/Responses'; import { Constants } from '../../utils'; export class OCPPConstants { @@ -23,8 +24,8 @@ export class OCPPConstants { 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_REQUEST_EMPTY = Constants.EMPTY_FROZEN_OBJECT; + static readonly OCPP_RESPONSE_EMPTY = Constants.EMPTY_FROZEN_OBJECT; static readonly OCPP_RESPONSE_ACCEPTED = Object.freeze({ status: GenericStatus.Accepted }); static readonly OCPP_RESPONSE_REJECTED = Object.freeze({ status: GenericStatus.Rejected }); @@ -97,10 +98,46 @@ export class OCPPConstants { status: TriggerMessageStatus.NOT_IMPLEMENTED, }); + static readonly OCPP_DATA_TRANSFER_RESPONSE_ACCEPTED = Object.freeze({ + status: DataTransferStatus.ACCEPTED, + }); + 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 charging station is not configured to accept reservations + + static readonly OCPP_RESERVATION_RESPONSE_UNAVAILABLE = Object.freeze({ + status: ReservationStatus.UNAVAILABLE, + }); // Reservation has not been made, because connector is in UNAVAILABLE state + + static readonly OCPP_CANCEL_RESERVATION_RESPONSE_ACCEPTED = Object.freeze({ + status: GenericStatus.Accepted, + }); // Reservation for id has been cancelled + + 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 }