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
18 static readonly OCPP_TRIGGER_MESSAGE_DELAY
= 500 // Ms
20 static readonly OCPP_MEASURANDS_SUPPORTED
= Object.freeze([
21 MeterValueMeasurand
.STATE_OF_CHARGE
,
22 MeterValueMeasurand
.VOLTAGE
,
23 MeterValueMeasurand
.POWER_ACTIVE_IMPORT
,
24 MeterValueMeasurand
.CURRENT_IMPORT
,
25 MeterValueMeasurand
.ENERGY_ACTIVE_IMPORT_REGISTER
28 static readonly OCPP_REQUEST_EMPTY
= Constants
.EMPTY_FROZEN_OBJECT
29 static readonly OCPP_RESPONSE_EMPTY
= Constants
.EMPTY_FROZEN_OBJECT
30 static readonly OCPP_RESPONSE_ACCEPTED
= Object.freeze({ status: GenericStatus
.Accepted
})
31 static readonly OCPP_RESPONSE_REJECTED
= Object.freeze({ status: GenericStatus
.Rejected
})
33 static readonly OCPP_CONFIGURATION_RESPONSE_ACCEPTED
= Object.freeze({
34 status: ConfigurationStatus
.ACCEPTED
37 static readonly OCPP_CONFIGURATION_RESPONSE_REJECTED
= Object.freeze({
38 status: ConfigurationStatus
.REJECTED
41 static readonly OCPP_CONFIGURATION_RESPONSE_REBOOT_REQUIRED
= Object.freeze({
42 status: ConfigurationStatus
.REBOOT_REQUIRED
45 static readonly OCPP_CONFIGURATION_RESPONSE_NOT_SUPPORTED
= Object.freeze({
46 status: ConfigurationStatus
.NOT_SUPPORTED
49 static readonly OCPP_SET_CHARGING_PROFILE_RESPONSE_ACCEPTED
= Object.freeze({
50 status: ChargingProfileStatus
.ACCEPTED
53 static readonly OCPP_SET_CHARGING_PROFILE_RESPONSE_REJECTED
= Object.freeze({
54 status: ChargingProfileStatus
.REJECTED
57 static readonly OCPP_SET_CHARGING_PROFILE_RESPONSE_NOT_SUPPORTED
= Object.freeze({
58 status: ChargingProfileStatus
.NOT_SUPPORTED
61 static readonly OCPP_CLEAR_CHARGING_PROFILE_RESPONSE_ACCEPTED
= Object.freeze({
62 status: ClearChargingProfileStatus
.ACCEPTED
65 static readonly OCPP_CLEAR_CHARGING_PROFILE_RESPONSE_UNKNOWN
= Object.freeze({
66 status: ClearChargingProfileStatus
.UNKNOWN
69 static readonly OCPP_RESPONSE_UNLOCKED
= Object.freeze({ status: UnlockStatus
.UNLOCKED
})
70 static readonly OCPP_RESPONSE_UNLOCK_FAILED
= Object.freeze({
71 status: UnlockStatus
.UNLOCK_FAILED
74 static readonly OCPP_RESPONSE_UNLOCK_NOT_SUPPORTED
= Object.freeze({
75 status: UnlockStatus
.NOT_SUPPORTED
78 static readonly OCPP_AVAILABILITY_RESPONSE_ACCEPTED
= Object.freeze({
79 status: AvailabilityStatus
.ACCEPTED
82 static readonly OCPP_AVAILABILITY_RESPONSE_REJECTED
= Object.freeze({
83 status: AvailabilityStatus
.REJECTED
86 static readonly OCPP_AVAILABILITY_RESPONSE_SCHEDULED
= Object.freeze({
87 status: AvailabilityStatus
.SCHEDULED
90 static readonly OCPP_TRIGGER_MESSAGE_RESPONSE_ACCEPTED
= Object.freeze({
91 status: TriggerMessageStatus
.ACCEPTED
94 static readonly OCPP_TRIGGER_MESSAGE_RESPONSE_REJECTED
= Object.freeze({
95 status: TriggerMessageStatus
.REJECTED
98 static readonly OCPP_TRIGGER_MESSAGE_RESPONSE_NOT_IMPLEMENTED
= Object.freeze({
99 status: TriggerMessageStatus
.NOT_IMPLEMENTED
102 static readonly OCPP_DATA_TRANSFER_RESPONSE_ACCEPTED
= Object.freeze({
103 status: DataTransferStatus
.ACCEPTED
106 static readonly OCPP_DATA_TRANSFER_RESPONSE_REJECTED
= Object.freeze({
107 status: DataTransferStatus
.REJECTED
110 static readonly OCPP_DATA_TRANSFER_RESPONSE_UNKNOWN_VENDOR_ID
= Object.freeze({
111 status: DataTransferStatus
.UNKNOWN_VENDOR_ID
114 static readonly OCPP_RESERVATION_RESPONSE_ACCEPTED
= Object.freeze({
115 status: ReservationStatus
.ACCEPTED
116 }) // Reservation has been made
118 static readonly OCPP_RESERVATION_RESPONSE_FAULTED
= Object.freeze({
119 status: ReservationStatus
.FAULTED
120 }) // Reservation has not been made, because of connector in FAULTED state
122 static readonly OCPP_RESERVATION_RESPONSE_OCCUPIED
= Object.freeze({
123 status: ReservationStatus
.OCCUPIED
124 }) // Reservation has not been made, because all connectors are OCCUPIED
126 static readonly OCPP_RESERVATION_RESPONSE_REJECTED
= Object.freeze({
127 status: ReservationStatus
.REJECTED
128 }) // Reservation has not been made, because charging station is not configured to accept reservations
130 static readonly OCPP_RESERVATION_RESPONSE_UNAVAILABLE
= Object.freeze({
131 status: ReservationStatus
.UNAVAILABLE
132 }) // Reservation has not been made, because connector is in UNAVAILABLE state
134 static readonly OCPP_CANCEL_RESERVATION_RESPONSE_ACCEPTED
= Object.freeze({
135 status: GenericStatus
.Accepted
136 }) // Reservation for id has been cancelled
138 static readonly OCPP_CANCEL_RESERVATION_RESPONSE_REJECTED
= Object.freeze({
139 status: GenericStatus
.Rejected
140 }) // Reservation could not be cancelled, because there is no reservation active for id
142 protected constructor () {
143 // This is intentional