4 ClearChargingProfileStatus
,
12 import { ReservationStatus
} from
'../../types/ocpp/Responses';
13 import { Constants
} from
'../../utils';
15 export class OCPPConstants
{
16 static readonly OCPP_WEBSOCKET_TIMEOUT
= 60000; // Ms
17 static readonly OCPP_TRIGGER_MESSAGE_DELAY
= 500; // Ms
19 static readonly OCPP_MEASURANDS_SUPPORTED
= Object.freeze([
20 MeterValueMeasurand
.STATE_OF_CHARGE
,
21 MeterValueMeasurand
.VOLTAGE
,
22 MeterValueMeasurand
.POWER_ACTIVE_IMPORT
,
23 MeterValueMeasurand
.CURRENT_IMPORT
,
24 MeterValueMeasurand
.ENERGY_ACTIVE_IMPORT_REGISTER
,
27 static readonly OCPP_REQUEST_EMPTY
= Constants
.EMPTY_FREEZED_OBJECT
;
28 static readonly OCPP_RESPONSE_EMPTY
= Constants
.EMPTY_FREEZED_OBJECT
;
29 static readonly OCPP_RESPONSE_ACCEPTED
= Object.freeze({ status: GenericStatus
.Accepted
});
30 static readonly OCPP_RESPONSE_REJECTED
= Object.freeze({ status: GenericStatus
.Rejected
});
32 static readonly OCPP_CONFIGURATION_RESPONSE_ACCEPTED
= Object.freeze({
33 status: ConfigurationStatus
.ACCEPTED
,
36 static readonly OCPP_CONFIGURATION_RESPONSE_REJECTED
= Object.freeze({
37 status: ConfigurationStatus
.REJECTED
,
40 static readonly OCPP_CONFIGURATION_RESPONSE_REBOOT_REQUIRED
= Object.freeze({
41 status: ConfigurationStatus
.REBOOT_REQUIRED
,
44 static readonly OCPP_CONFIGURATION_RESPONSE_NOT_SUPPORTED
= Object.freeze({
45 status: ConfigurationStatus
.NOT_SUPPORTED
,
48 static readonly OCPP_SET_CHARGING_PROFILE_RESPONSE_ACCEPTED
= Object.freeze({
49 status: ChargingProfileStatus
.ACCEPTED
,
52 static readonly OCPP_SET_CHARGING_PROFILE_RESPONSE_REJECTED
= Object.freeze({
53 status: ChargingProfileStatus
.REJECTED
,
56 static readonly OCPP_SET_CHARGING_PROFILE_RESPONSE_NOT_SUPPORTED
= Object.freeze({
57 status: ChargingProfileStatus
.NOT_SUPPORTED
,
60 static readonly OCPP_CLEAR_CHARGING_PROFILE_RESPONSE_ACCEPTED
= Object.freeze({
61 status: ClearChargingProfileStatus
.ACCEPTED
,
64 static readonly OCPP_CLEAR_CHARGING_PROFILE_RESPONSE_UNKNOWN
= Object.freeze({
65 status: ClearChargingProfileStatus
.UNKNOWN
,
68 static readonly OCPP_RESPONSE_UNLOCKED
= Object.freeze({ status: UnlockStatus
.UNLOCKED
});
69 static readonly OCPP_RESPONSE_UNLOCK_FAILED
= Object.freeze({
70 status: UnlockStatus
.UNLOCK_FAILED
,
73 static readonly OCPP_RESPONSE_UNLOCK_NOT_SUPPORTED
= Object.freeze({
74 status: UnlockStatus
.NOT_SUPPORTED
,
77 static readonly OCPP_AVAILABILITY_RESPONSE_ACCEPTED
= Object.freeze({
78 status: AvailabilityStatus
.ACCEPTED
,
81 static readonly OCPP_AVAILABILITY_RESPONSE_REJECTED
= Object.freeze({
82 status: AvailabilityStatus
.REJECTED
,
85 static readonly OCPP_AVAILABILITY_RESPONSE_SCHEDULED
= Object.freeze({
86 status: AvailabilityStatus
.SCHEDULED
,
89 static readonly OCPP_TRIGGER_MESSAGE_RESPONSE_ACCEPTED
= Object.freeze({
90 status: TriggerMessageStatus
.ACCEPTED
,
93 static readonly OCPP_TRIGGER_MESSAGE_RESPONSE_REJECTED
= Object.freeze({
94 status: TriggerMessageStatus
.REJECTED
,
97 static readonly OCPP_TRIGGER_MESSAGE_RESPONSE_NOT_IMPLEMENTED
= Object.freeze({
98 status: TriggerMessageStatus
.NOT_IMPLEMENTED
,
101 static readonly OCPP_DATA_TRANSFER_RESPONSE_ACCEPTED
= Object.freeze({
102 status: DataTransferStatus
.ACCEPTED
,
105 static readonly OCPP_DATA_TRANSFER_RESPONSE_REJECTED
= Object.freeze({
106 status: DataTransferStatus
.REJECTED
,
109 static readonly OCPP_DATA_TRANSFER_RESPONSE_UNKNOWN_VENDOR_ID
= Object.freeze({
110 status: DataTransferStatus
.UNKNOWN_VENDOR_ID
,
113 static readonly OCPP_RESERVATION_RESPONSE_ACCEPTED
= Object.freeze({
114 status: ReservationStatus
.ACCEPTED
,
115 }); // Reservation has been made
117 static readonly OCPP_RESERVATION_RESPONSE_FAULTED
= Object.freeze({
118 status: ReservationStatus
.FAULTED
,
119 }); // Reservation has not been made, because of connector in FAULTED state
121 static readonly OCPP_RESERVATION_RESPONSE_OCCUPIED
= Object.freeze({
122 status: ReservationStatus
.OCCUPIED
,
123 }); // Reservation has not been made, because all connectors are OCCUPIED
125 static readonly OCPP_RESERVATION_RESPONSE_REJECTED
= Object.freeze({
126 status: ReservationStatus
.REJECTED
,
127 }); // Reservation has not been made, because charging station is not configured to accept reservations
129 static readonly OCPP_RESERVATION_RESPONSE_UNAVAILABLE
= Object.freeze({
130 status: ReservationStatus
.UNAVAILABLE
,
131 }); // Reservation has not been made, because connectors are spec. connector is in UNAVAILABLE state
133 static readonly OCPP_CANCEL_RESERVATION_RESPONSE_ACCEPTED
= Object.freeze({
134 status: GenericStatus
.Accepted
,
135 }); // Reservation for id has been cancelled has been made
137 static readonly OCPP_CANCEL_RESERVATION_RESPONSE_REJECTED
= Object.freeze({
138 status: GenericStatus
.Rejected
,
139 }); // Reservation could not be cancelled, because there is no reservation active for id
141 protected constructor() {
142 // This is intentional