4 ClearChargingProfileStatus
,
12 } from
'../../types/index.js'
13 import { Constants
} from
'../../utils/index.js'
15 // eslint-disable-next-line @typescript-eslint/no-extraneous-class
16 export class OCPPConstants
{
17 static readonly OCPP_WEBSOCKET_TIMEOUT
= 60000 // 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_FROZEN_OBJECT
28 static readonly OCPP_RESPONSE_EMPTY
= Constants
.EMPTY_FROZEN_OBJECT
29 static readonly OCPP_RESPONSE_ACCEPTED
= Object.freeze({
30 status: GenericStatus
.Accepted
33 static readonly OCPP_RESPONSE_REJECTED
= Object.freeze({
34 status: GenericStatus
.Rejected
37 static readonly OCPP_CONFIGURATION_RESPONSE_ACCEPTED
= Object.freeze({
38 status: ConfigurationStatus
.ACCEPTED
41 static readonly OCPP_CONFIGURATION_RESPONSE_REJECTED
= Object.freeze({
42 status: ConfigurationStatus
.REJECTED
45 static readonly OCPP_CONFIGURATION_RESPONSE_REBOOT_REQUIRED
= Object.freeze({
46 status: ConfigurationStatus
.REBOOT_REQUIRED
49 static readonly OCPP_CONFIGURATION_RESPONSE_NOT_SUPPORTED
= Object.freeze({
50 status: ConfigurationStatus
.NOT_SUPPORTED
53 static readonly OCPP_SET_CHARGING_PROFILE_RESPONSE_ACCEPTED
= Object.freeze({
54 status: ChargingProfileStatus
.ACCEPTED
57 static readonly OCPP_SET_CHARGING_PROFILE_RESPONSE_REJECTED
= Object.freeze({
58 status: ChargingProfileStatus
.REJECTED
61 static readonly OCPP_SET_CHARGING_PROFILE_RESPONSE_NOT_SUPPORTED
= Object.freeze({
62 status: ChargingProfileStatus
.NOT_SUPPORTED
65 static readonly OCPP_CLEAR_CHARGING_PROFILE_RESPONSE_ACCEPTED
= Object.freeze({
66 status: ClearChargingProfileStatus
.ACCEPTED
69 static readonly OCPP_CLEAR_CHARGING_PROFILE_RESPONSE_UNKNOWN
= Object.freeze({
70 status: ClearChargingProfileStatus
.UNKNOWN
73 static readonly OCPP_RESPONSE_UNLOCKED
= Object.freeze({
74 status: UnlockStatus
.UNLOCKED
77 static readonly OCPP_RESPONSE_UNLOCK_FAILED
= Object.freeze({
78 status: UnlockStatus
.UNLOCK_FAILED
81 static readonly OCPP_RESPONSE_UNLOCK_NOT_SUPPORTED
= Object.freeze({
82 status: UnlockStatus
.NOT_SUPPORTED
85 static readonly OCPP_AVAILABILITY_RESPONSE_ACCEPTED
= Object.freeze({
86 status: AvailabilityStatus
.ACCEPTED
89 static readonly OCPP_AVAILABILITY_RESPONSE_REJECTED
= Object.freeze({
90 status: AvailabilityStatus
.REJECTED
93 static readonly OCPP_AVAILABILITY_RESPONSE_SCHEDULED
= Object.freeze({
94 status: AvailabilityStatus
.SCHEDULED
97 static readonly OCPP_TRIGGER_MESSAGE_RESPONSE_ACCEPTED
= Object.freeze({
98 status: TriggerMessageStatus
.ACCEPTED
101 static readonly OCPP_TRIGGER_MESSAGE_RESPONSE_REJECTED
= Object.freeze({
102 status: TriggerMessageStatus
.REJECTED
105 static readonly OCPP_TRIGGER_MESSAGE_RESPONSE_NOT_IMPLEMENTED
= Object.freeze({
106 status: TriggerMessageStatus
.NOT_IMPLEMENTED
109 static readonly OCPP_DATA_TRANSFER_RESPONSE_ACCEPTED
= Object.freeze({
110 status: DataTransferStatus
.ACCEPTED
113 static readonly OCPP_DATA_TRANSFER_RESPONSE_REJECTED
= Object.freeze({
114 status: DataTransferStatus
.REJECTED
117 static readonly OCPP_DATA_TRANSFER_RESPONSE_UNKNOWN_VENDOR_ID
= Object.freeze({
118 status: DataTransferStatus
.UNKNOWN_VENDOR_ID
121 static readonly OCPP_RESERVATION_RESPONSE_ACCEPTED
= Object.freeze({
122 status: ReservationStatus
.ACCEPTED
123 }) // Reservation has been made
125 static readonly OCPP_RESERVATION_RESPONSE_FAULTED
= Object.freeze({
126 status: ReservationStatus
.FAULTED
127 }) // Reservation has not been made, because of connector in FAULTED state
129 static readonly OCPP_RESERVATION_RESPONSE_OCCUPIED
= Object.freeze({
130 status: ReservationStatus
.OCCUPIED
131 }) // Reservation has not been made, because all connectors are OCCUPIED
133 static readonly OCPP_RESERVATION_RESPONSE_REJECTED
= Object.freeze({
134 status: ReservationStatus
.REJECTED
135 }) // Reservation has not been made, because charging station is not configured to accept reservations
137 static readonly OCPP_RESERVATION_RESPONSE_UNAVAILABLE
= Object.freeze({
138 status: ReservationStatus
.UNAVAILABLE
139 }) // Reservation has not been made, because connector is in UNAVAILABLE state
141 static readonly OCPP_CANCEL_RESERVATION_RESPONSE_ACCEPTED
= Object.freeze({
142 status: GenericStatus
.Accepted
143 }) // Reservation for id has been cancelled
145 static readonly OCPP_CANCEL_RESERVATION_RESPONSE_REJECTED
= Object.freeze({
146 status: GenericStatus
.Rejected
147 }) // Reservation could not be cancelled, because there is no reservation active for id
149 protected constructor () {
150 // This is intentional