Commit | Line | Data |
---|---|---|
69074173 JB |
1 | import type { OCPP16ChargePointErrorCode } from './ChargePointErrorCode'; |
2 | import type { OCPP16ChargePointStatus } from './ChargePointStatus'; | |
2896e06d | 3 | import type { |
2896e06d | 4 | OCPP16ChargingProfile, |
0ac97927 | 5 | OCPP16ChargingProfilePurposeType, |
41189456 | 6 | OCPP16ChargingRateUnitType, |
69074173 JB |
7 | } from './ChargingProfile'; |
8 | import type { OCPP16StandardParametersKey, OCPP16VendorParametersKey } from './Configuration'; | |
9 | import type { OCPP16DiagnosticsStatus } from './DiagnosticsStatus'; | |
10 | import type { EmptyObject } from '../../EmptyObject'; | |
11 | import type { JsonObject } from '../../JsonType'; | |
5bd15d76 | 12 | |
c0560973 | 13 | export enum OCPP16RequestCommand { |
d9f60ba1 JB |
14 | BOOT_NOTIFICATION = 'BootNotification', |
15 | HEARTBEAT = 'Heartbeat', | |
16 | STATUS_NOTIFICATION = 'StatusNotification', | |
ef6076c1 | 17 | AUTHORIZE = 'Authorize', |
d9f60ba1 JB |
18 | START_TRANSACTION = 'StartTransaction', |
19 | STOP_TRANSACTION = 'StopTransaction', | |
47e22477 | 20 | METER_VALUES = 'MeterValues', |
e7aeea18 | 21 | DIAGNOSTICS_STATUS_NOTIFICATION = 'DiagnosticsStatusNotification', |
d4c84337 | 22 | FIRMWARE_STATUS_NOTIFICATION = 'FirmwareStatusNotification', |
91a7d3ea | 23 | DATA_TRANSFER = 'DataTransfer', |
24578c31 JB |
24 | RESERVE_NOW = 'ReserveNow', |
25 | CANCEL_RESERVATION = 'CancelReservation', | |
d9f60ba1 JB |
26 | } |
27 | ||
953d6b02 JB |
28 | export enum OCPP16IncomingRequestCommand { |
29 | RESET = 'Reset', | |
30 | CLEAR_CACHE = 'ClearCache', | |
31 | CHANGE_AVAILABILITY = 'ChangeAvailability', | |
32 | UNLOCK_CONNECTOR = 'UnlockConnector', | |
33 | GET_CONFIGURATION = 'GetConfiguration', | |
34 | CHANGE_CONFIGURATION = 'ChangeConfiguration', | |
41189456 | 35 | GET_COMPOSITE_SCHEDULE = 'GetCompositeSchedule', |
953d6b02 JB |
36 | SET_CHARGING_PROFILE = 'SetChargingProfile', |
37 | CLEAR_CHARGING_PROFILE = 'ClearChargingProfile', | |
38 | REMOTE_START_TRANSACTION = 'RemoteStartTransaction', | |
39 | REMOTE_STOP_TRANSACTION = 'RemoteStopTransaction', | |
40 | GET_DIAGNOSTICS = 'GetDiagnostics', | |
41 | TRIGGER_MESSAGE = 'TriggerMessage', | |
42 | DATA_TRANSFER = 'DataTransfer', | |
43 | UPDATE_FIRMWARE = 'UpdateFirmware', | |
24578c31 JB |
44 | RESERVE_NOW = 'ReserveNow', |
45 | CANCEL_RESERVATION = 'CancelReservation', | |
953d6b02 JB |
46 | } |
47 | ||
ef6fa3fb | 48 | export type OCPP16HeartbeatRequest = EmptyObject; |
f738a0e9 | 49 | |
e3822d6f | 50 | export interface OCPP16BootNotificationRequest extends JsonObject { |
fec4d204 | 51 | chargePointVendor: string; |
f738a0e9 JB |
52 | chargePointModel: string; |
53 | chargePointSerialNumber?: string; | |
fec4d204 | 54 | chargeBoxSerialNumber?: string; |
f738a0e9 JB |
55 | firmwareVersion?: string; |
56 | iccid?: string; | |
57 | imsi?: string; | |
f738a0e9 | 58 | meterType?: string; |
fec4d204 | 59 | meterSerialNumber?: string; |
f738a0e9 JB |
60 | } |
61 | ||
e3822d6f | 62 | export interface OCPP16StatusNotificationRequest extends JsonObject { |
f738a0e9 | 63 | connectorId: number; |
c0560973 | 64 | errorCode: OCPP16ChargePointErrorCode; |
c0560973 | 65 | status: OCPP16ChargePointStatus; |
a9ed42b2 | 66 | info?: string; |
c38f0ced | 67 | timestamp?: Date; |
f738a0e9 JB |
68 | vendorId?: string; |
69 | vendorErrorCode?: string; | |
70 | } | |
71 | ||
e3018bc4 JB |
72 | export type OCPP16ClearCacheRequest = EmptyObject; |
73 | ||
6dad8e21 JB |
74 | type OCPP16ConfigurationKey = string | OCPP16StandardParametersKey | OCPP16VendorParametersKey; |
75 | ||
e3822d6f | 76 | export interface ChangeConfigurationRequest extends JsonObject { |
6dad8e21 | 77 | key: OCPP16ConfigurationKey; |
f738a0e9 JB |
78 | value: string; |
79 | } | |
80 | ||
e3822d6f | 81 | export interface RemoteStartTransactionRequest extends JsonObject { |
f738a0e9 JB |
82 | connectorId: number; |
83 | idTag: string; | |
c0560973 | 84 | chargingProfile?: OCPP16ChargingProfile; |
f738a0e9 JB |
85 | } |
86 | ||
e3822d6f | 87 | export interface RemoteStopTransactionRequest extends JsonObject { |
f738a0e9 JB |
88 | transactionId: number; |
89 | } | |
90 | ||
e3822d6f | 91 | export interface UnlockConnectorRequest extends JsonObject { |
f738a0e9 JB |
92 | connectorId: number; |
93 | } | |
94 | ||
e3822d6f | 95 | export interface GetConfigurationRequest extends JsonObject { |
6dad8e21 | 96 | key?: OCPP16ConfigurationKey[]; |
f738a0e9 JB |
97 | } |
98 | ||
0ac97927 | 99 | enum ResetType { |
f738a0e9 | 100 | HARD = 'Hard', |
e7aeea18 | 101 | SOFT = 'Soft', |
f738a0e9 JB |
102 | } |
103 | ||
e3822d6f | 104 | export interface ResetRequest extends JsonObject { |
f738a0e9 | 105 | type: ResetType; |
63b48f77 | 106 | } |
8c476a1f | 107 | |
41189456 JB |
108 | export interface OCPP16GetCompositeScheduleRequest extends JsonObject { |
109 | connectorId: number; | |
110 | duration: number; | |
111 | chargingRateUnit?: OCPP16ChargingRateUnitType; | |
112 | } | |
113 | ||
e3822d6f | 114 | export interface SetChargingProfileRequest extends JsonObject { |
8c476a1f | 115 | connectorId: number; |
c0560973 | 116 | csChargingProfiles: OCPP16ChargingProfile; |
8c476a1f | 117 | } |
4dff73b0 | 118 | |
c0560973 | 119 | export enum OCPP16AvailabilityType { |
0d6f335f JB |
120 | Inoperative = 'Inoperative', |
121 | Operative = 'Operative', | |
4dff73b0 JB |
122 | } |
123 | ||
e3822d6f | 124 | export interface ChangeAvailabilityRequest extends JsonObject { |
4dff73b0 | 125 | connectorId: number; |
c0560973 | 126 | type: OCPP16AvailabilityType; |
4dff73b0 | 127 | } |
edf4bd64 | 128 | |
e3822d6f | 129 | export interface ClearChargingProfileRequest extends JsonObject { |
edf4bd64 JB |
130 | id?: number; |
131 | connectorId?: number; | |
0ac97927 | 132 | chargingProfilePurpose?: OCPP16ChargingProfilePurposeType; |
edf4bd64 JB |
133 | stackLevel?: number; |
134 | } | |
47e22477 | 135 | |
b03df580 JB |
136 | export interface OCPP16UpdateFirmwareRequest extends JsonObject { |
137 | location: string; | |
138 | retrieveDate: Date; | |
139 | retries?: number; | |
140 | retryInterval?: number; | |
141 | } | |
142 | ||
d4c84337 JB |
143 | export enum OCPP16FirmwareStatus { |
144 | Downloaded = 'Downloaded', | |
145 | DownloadFailed = 'DownloadFailed', | |
146 | Downloading = 'Downloading', | |
147 | Idle = 'Idle', | |
148 | InstallationFailed = 'InstallationFailed', | |
149 | Installing = 'Installing', | |
150 | Installed = 'Installed', | |
151 | } | |
152 | ||
153 | export type OCPP16FirmwareStatusNotificationRequest = { | |
154 | status: OCPP16FirmwareStatus; | |
c9a4f9ea | 155 | } & JsonObject; |
d4c84337 | 156 | |
e3822d6f | 157 | export interface GetDiagnosticsRequest extends JsonObject { |
47e22477 JB |
158 | location: string; |
159 | retries?: number; | |
160 | retryInterval?: number; | |
161 | startTime?: Date; | |
162 | stopTime?: Date; | |
163 | } | |
164 | ||
c9a4f9ea | 165 | export interface OCPP16DiagnosticsStatusNotificationRequest extends JsonObject { |
e7aeea18 | 166 | status: OCPP16DiagnosticsStatus; |
47e22477 | 167 | } |
802cfa13 | 168 | |
c60ed4b8 | 169 | export enum OCPP16MessageTrigger { |
802cfa13 JB |
170 | BootNotification = 'BootNotification', |
171 | DiagnosticsStatusNotification = 'DiagnosticsStatusNotification', | |
172 | FirmwareStatusNotification = 'FirmwareStatusNotification', | |
173 | Heartbeat = 'Heartbeat', | |
174 | MeterValues = 'MeterValues', | |
e7aeea18 | 175 | StatusNotification = 'StatusNotification', |
802cfa13 JB |
176 | } |
177 | ||
e3822d6f | 178 | export interface OCPP16TriggerMessageRequest extends JsonObject { |
c60ed4b8 | 179 | requestedMessage: OCPP16MessageTrigger; |
e7aeea18 | 180 | connectorId?: number; |
802cfa13 | 181 | } |
91a7d3ea | 182 | |
77b95a89 JB |
183 | export enum OCPP16DataTransferVendorId {} |
184 | ||
91a7d3ea JB |
185 | export interface OCPP16DataTransferRequest extends JsonObject { |
186 | vendorId: string; | |
187 | messageId?: string; | |
188 | data?: string; | |
189 | } | |
db652e1e JB |
190 | |
191 | export interface OCPP16ReserveNowRequest { | |
24578c31 | 192 | connectorId: number; |
db652e1e JB |
193 | expiryDate: Date; |
194 | idTag: string; | |
195 | parentIdTag?: string; | |
196 | reservationId: number; | |
197 | } | |
198 | ||
199 | export interface OCPP16CancelReservationRequest { | |
200 | reservationId: number; | |
201 | } |