Commit | Line | Data |
---|---|---|
2896e06d | 1 | import type { |
2896e06d JB |
2 | EmptyObject, |
3 | JsonObject, | |
4 | OCPP16ChargePointErrorCode, | |
5 | OCPP16ChargePointStatus, | |
6 | OCPP16ChargingProfile, | |
0ac97927 | 7 | OCPP16ChargingProfilePurposeType, |
2896e06d JB |
8 | OCPP16DiagnosticsStatus, |
9 | OCPP16StandardParametersKey, | |
6dad8e21 | 10 | OCPP16VendorParametersKey, |
2896e06d | 11 | } from '../../internal'; |
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', | |
33 | SET_CHARGING_PROFILE = 'SetChargingProfile', | |
34 | CLEAR_CHARGING_PROFILE = 'ClearChargingProfile', | |
35 | REMOTE_START_TRANSACTION = 'RemoteStartTransaction', | |
36 | REMOTE_STOP_TRANSACTION = 'RemoteStopTransaction', | |
37 | GET_DIAGNOSTICS = 'GetDiagnostics', | |
38 | TRIGGER_MESSAGE = 'TriggerMessage', | |
39 | DATA_TRANSFER = 'DataTransfer', | |
40 | UPDATE_FIRMWARE = 'UpdateFirmware', | |
41 | } | |
42 | ||
ef6fa3fb | 43 | export type OCPP16HeartbeatRequest = EmptyObject; |
f738a0e9 | 44 | |
e3822d6f | 45 | export interface OCPP16BootNotificationRequest extends JsonObject { |
fec4d204 | 46 | chargePointVendor: string; |
f738a0e9 JB |
47 | chargePointModel: string; |
48 | chargePointSerialNumber?: string; | |
fec4d204 | 49 | chargeBoxSerialNumber?: string; |
f738a0e9 JB |
50 | firmwareVersion?: string; |
51 | iccid?: string; | |
52 | imsi?: string; | |
f738a0e9 | 53 | meterType?: string; |
fec4d204 | 54 | meterSerialNumber?: string; |
f738a0e9 JB |
55 | } |
56 | ||
e3822d6f | 57 | export interface OCPP16StatusNotificationRequest extends JsonObject { |
f738a0e9 | 58 | connectorId: number; |
c0560973 | 59 | errorCode: OCPP16ChargePointErrorCode; |
c0560973 | 60 | status: OCPP16ChargePointStatus; |
a9ed42b2 | 61 | info?: string; |
c38f0ced | 62 | timestamp?: Date; |
f738a0e9 JB |
63 | vendorId?: string; |
64 | vendorErrorCode?: string; | |
65 | } | |
66 | ||
e3018bc4 JB |
67 | export type OCPP16ClearCacheRequest = EmptyObject; |
68 | ||
6dad8e21 JB |
69 | type OCPP16ConfigurationKey = string | OCPP16StandardParametersKey | OCPP16VendorParametersKey; |
70 | ||
e3822d6f | 71 | export interface ChangeConfigurationRequest extends JsonObject { |
6dad8e21 | 72 | key: OCPP16ConfigurationKey; |
f738a0e9 JB |
73 | value: string; |
74 | } | |
75 | ||
e3822d6f | 76 | export interface RemoteStartTransactionRequest extends JsonObject { |
f738a0e9 JB |
77 | connectorId: number; |
78 | idTag: string; | |
c0560973 | 79 | chargingProfile?: OCPP16ChargingProfile; |
f738a0e9 JB |
80 | } |
81 | ||
e3822d6f | 82 | export interface RemoteStopTransactionRequest extends JsonObject { |
f738a0e9 JB |
83 | transactionId: number; |
84 | } | |
85 | ||
e3822d6f | 86 | export interface UnlockConnectorRequest extends JsonObject { |
f738a0e9 JB |
87 | connectorId: number; |
88 | } | |
89 | ||
e3822d6f | 90 | export interface GetConfigurationRequest extends JsonObject { |
6dad8e21 | 91 | key?: OCPP16ConfigurationKey[]; |
f738a0e9 JB |
92 | } |
93 | ||
0ac97927 | 94 | enum ResetType { |
f738a0e9 | 95 | HARD = 'Hard', |
e7aeea18 | 96 | SOFT = 'Soft', |
f738a0e9 JB |
97 | } |
98 | ||
e3822d6f | 99 | export interface ResetRequest extends JsonObject { |
f738a0e9 | 100 | type: ResetType; |
63b48f77 | 101 | } |
8c476a1f | 102 | |
e3822d6f | 103 | export interface SetChargingProfileRequest extends JsonObject { |
8c476a1f | 104 | connectorId: number; |
c0560973 | 105 | csChargingProfiles: OCPP16ChargingProfile; |
8c476a1f | 106 | } |
4dff73b0 | 107 | |
c0560973 | 108 | export enum OCPP16AvailabilityType { |
4dff73b0 | 109 | INOPERATIVE = 'Inoperative', |
e7aeea18 | 110 | OPERATIVE = 'Operative', |
4dff73b0 JB |
111 | } |
112 | ||
e3822d6f | 113 | export interface ChangeAvailabilityRequest extends JsonObject { |
4dff73b0 | 114 | connectorId: number; |
c0560973 | 115 | type: OCPP16AvailabilityType; |
4dff73b0 | 116 | } |
edf4bd64 | 117 | |
e3822d6f | 118 | export interface ClearChargingProfileRequest extends JsonObject { |
edf4bd64 JB |
119 | id?: number; |
120 | connectorId?: number; | |
0ac97927 | 121 | chargingProfilePurpose?: OCPP16ChargingProfilePurposeType; |
edf4bd64 JB |
122 | stackLevel?: number; |
123 | } | |
47e22477 | 124 | |
b03df580 JB |
125 | export interface OCPP16UpdateFirmwareRequest extends JsonObject { |
126 | location: string; | |
127 | retrieveDate: Date; | |
128 | retries?: number; | |
129 | retryInterval?: number; | |
130 | } | |
131 | ||
d4c84337 JB |
132 | export enum OCPP16FirmwareStatus { |
133 | Downloaded = 'Downloaded', | |
134 | DownloadFailed = 'DownloadFailed', | |
135 | Downloading = 'Downloading', | |
136 | Idle = 'Idle', | |
137 | InstallationFailed = 'InstallationFailed', | |
138 | Installing = 'Installing', | |
139 | Installed = 'Installed', | |
140 | } | |
141 | ||
142 | export type OCPP16FirmwareStatusNotificationRequest = { | |
143 | status: OCPP16FirmwareStatus; | |
c9a4f9ea | 144 | } & JsonObject; |
d4c84337 | 145 | |
e3822d6f | 146 | export interface GetDiagnosticsRequest extends JsonObject { |
47e22477 JB |
147 | location: string; |
148 | retries?: number; | |
149 | retryInterval?: number; | |
150 | startTime?: Date; | |
151 | stopTime?: Date; | |
152 | } | |
153 | ||
c9a4f9ea | 154 | export interface OCPP16DiagnosticsStatusNotificationRequest extends JsonObject { |
e7aeea18 | 155 | status: OCPP16DiagnosticsStatus; |
47e22477 | 156 | } |
802cfa13 | 157 | |
c60ed4b8 | 158 | export enum OCPP16MessageTrigger { |
802cfa13 JB |
159 | BootNotification = 'BootNotification', |
160 | DiagnosticsStatusNotification = 'DiagnosticsStatusNotification', | |
161 | FirmwareStatusNotification = 'FirmwareStatusNotification', | |
162 | Heartbeat = 'Heartbeat', | |
163 | MeterValues = 'MeterValues', | |
e7aeea18 | 164 | StatusNotification = 'StatusNotification', |
802cfa13 JB |
165 | } |
166 | ||
e3822d6f | 167 | export interface OCPP16TriggerMessageRequest extends JsonObject { |
c60ed4b8 | 168 | requestedMessage: OCPP16MessageTrigger; |
e7aeea18 | 169 | connectorId?: number; |
802cfa13 | 170 | } |
91a7d3ea | 171 | |
77b95a89 JB |
172 | export enum OCPP16DataTransferVendorId {} |
173 | ||
91a7d3ea JB |
174 | export interface OCPP16DataTransferRequest extends JsonObject { |
175 | vendorId: string; | |
176 | messageId?: string; | |
177 | data?: string; | |
178 | } |