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