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