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