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