Commit | Line | Data |
---|---|---|
bf53cadf JB |
1 | import { |
2 | AvailabilityStatus, | |
3 | ChargingProfileStatus, | |
4 | ClearChargingProfileStatus, | |
5 | ConfigurationStatus, | |
6 | DataTransferStatus, | |
f03e1042 | 7 | GenericStatus, |
bf53cadf JB |
8 | TriggerMessageStatus, |
9 | UnlockStatus, | |
268a74bb | 10 | } from '../../types'; |
59b6ed8d | 11 | import { Constants } from '../../utils'; |
bf53cadf | 12 | |
268a74bb | 13 | export class OCPPConstants { |
59b6ed8d JB |
14 | static readonly OCPP_REQUEST_EMPTY = Constants.EMPTY_FREEZED_OBJECT; |
15 | static readonly OCPP_RESPONSE_EMPTY = Constants.EMPTY_FREEZED_OBJECT; | |
6b635033 JB |
16 | static readonly OCPP_RESPONSE_ACCEPTED = Object.freeze({ status: GenericStatus.Accepted }); |
17 | static readonly OCPP_RESPONSE_REJECTED = Object.freeze({ status: GenericStatus.Rejected }); | |
bf53cadf JB |
18 | |
19 | static readonly OCPP_CONFIGURATION_RESPONSE_ACCEPTED = Object.freeze({ | |
20 | status: ConfigurationStatus.ACCEPTED, | |
21 | }); | |
22 | ||
23 | static readonly OCPP_CONFIGURATION_RESPONSE_REJECTED = Object.freeze({ | |
24 | status: ConfigurationStatus.REJECTED, | |
25 | }); | |
26 | ||
27 | static readonly OCPP_CONFIGURATION_RESPONSE_REBOOT_REQUIRED = Object.freeze({ | |
28 | status: ConfigurationStatus.REBOOT_REQUIRED, | |
29 | }); | |
30 | ||
31 | static readonly OCPP_CONFIGURATION_RESPONSE_NOT_SUPPORTED = Object.freeze({ | |
32 | status: ConfigurationStatus.NOT_SUPPORTED, | |
33 | }); | |
34 | ||
35 | static readonly OCPP_SET_CHARGING_PROFILE_RESPONSE_ACCEPTED = Object.freeze({ | |
36 | status: ChargingProfileStatus.ACCEPTED, | |
37 | }); | |
38 | ||
39 | static readonly OCPP_SET_CHARGING_PROFILE_RESPONSE_REJECTED = Object.freeze({ | |
40 | status: ChargingProfileStatus.REJECTED, | |
41 | }); | |
42 | ||
43 | static readonly OCPP_SET_CHARGING_PROFILE_RESPONSE_NOT_SUPPORTED = Object.freeze({ | |
44 | status: ChargingProfileStatus.NOT_SUPPORTED, | |
45 | }); | |
46 | ||
47 | static readonly OCPP_CLEAR_CHARGING_PROFILE_RESPONSE_ACCEPTED = Object.freeze({ | |
48 | status: ClearChargingProfileStatus.ACCEPTED, | |
49 | }); | |
50 | ||
51 | static readonly OCPP_CLEAR_CHARGING_PROFILE_RESPONSE_UNKNOWN = Object.freeze({ | |
52 | status: ClearChargingProfileStatus.UNKNOWN, | |
53 | }); | |
54 | ||
55 | static readonly OCPP_RESPONSE_UNLOCKED = Object.freeze({ status: UnlockStatus.UNLOCKED }); | |
56 | static readonly OCPP_RESPONSE_UNLOCK_FAILED = Object.freeze({ | |
57 | status: UnlockStatus.UNLOCK_FAILED, | |
58 | }); | |
59 | ||
60 | static readonly OCPP_RESPONSE_UNLOCK_NOT_SUPPORTED = Object.freeze({ | |
61 | status: UnlockStatus.NOT_SUPPORTED, | |
62 | }); | |
63 | ||
64 | static readonly OCPP_AVAILABILITY_RESPONSE_ACCEPTED = Object.freeze({ | |
65 | status: AvailabilityStatus.ACCEPTED, | |
66 | }); | |
67 | ||
68 | static readonly OCPP_AVAILABILITY_RESPONSE_REJECTED = Object.freeze({ | |
69 | status: AvailabilityStatus.REJECTED, | |
70 | }); | |
71 | ||
72 | static readonly OCPP_AVAILABILITY_RESPONSE_SCHEDULED = Object.freeze({ | |
73 | status: AvailabilityStatus.SCHEDULED, | |
74 | }); | |
75 | ||
76 | static readonly OCPP_TRIGGER_MESSAGE_RESPONSE_ACCEPTED = Object.freeze({ | |
77 | status: TriggerMessageStatus.ACCEPTED, | |
78 | }); | |
79 | ||
80 | static readonly OCPP_TRIGGER_MESSAGE_RESPONSE_REJECTED = Object.freeze({ | |
81 | status: TriggerMessageStatus.REJECTED, | |
82 | }); | |
83 | ||
84 | static readonly OCPP_TRIGGER_MESSAGE_RESPONSE_NOT_IMPLEMENTED = Object.freeze({ | |
85 | status: TriggerMessageStatus.NOT_IMPLEMENTED, | |
86 | }); | |
87 | ||
88 | static readonly OCPP_DATA_TRANSFER_RESPONSE_REJECTED = Object.freeze({ | |
89 | status: DataTransferStatus.REJECTED, | |
90 | }); | |
91 | ||
92 | private constructor() { | |
93 | // This is intentional | |
94 | } | |
95 | } |