bc45189844dcd9fd09e5f29a717d9375bd25d163
[e-mobility-charging-stations-simulator.git] / src / types / ocpp / 1.6 / Requests.ts
1 import type {
2 EmptyObject,
3 JsonObject,
4 OCPP16ChargePointErrorCode,
5 OCPP16ChargePointStatus,
6 OCPP16ChargingProfile,
7 OCPP16ChargingProfilePurposeType,
8 OCPP16DiagnosticsStatus,
9 OCPP16StandardParametersKey,
10 OCPP16VendorParametersKey,
11 } from '../../internal';
12
13 export enum OCPP16RequestCommand {
14 BOOT_NOTIFICATION = 'BootNotification',
15 HEARTBEAT = 'Heartbeat',
16 STATUS_NOTIFICATION = 'StatusNotification',
17 AUTHORIZE = 'Authorize',
18 START_TRANSACTION = 'StartTransaction',
19 STOP_TRANSACTION = 'StopTransaction',
20 METER_VALUES = 'MeterValues',
21 DIAGNOSTICS_STATUS_NOTIFICATION = 'DiagnosticsStatusNotification',
22 FIRMWARE_STATUS_NOTIFICATION = 'FirmwareStatusNotification',
23 DATA_TRANSFER = 'DataTransfer',
24 }
25
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
43 export type OCPP16HeartbeatRequest = EmptyObject;
44
45 export interface OCPP16BootNotificationRequest extends JsonObject {
46 chargePointVendor: string;
47 chargePointModel: string;
48 chargePointSerialNumber?: string;
49 chargeBoxSerialNumber?: string;
50 firmwareVersion?: string;
51 iccid?: string;
52 imsi?: string;
53 meterType?: string;
54 meterSerialNumber?: string;
55 }
56
57 export interface OCPP16StatusNotificationRequest extends JsonObject {
58 connectorId: number;
59 errorCode: OCPP16ChargePointErrorCode;
60 status: OCPP16ChargePointStatus;
61 info?: string;
62 timestamp?: Date;
63 vendorId?: string;
64 vendorErrorCode?: string;
65 }
66
67 export type OCPP16ClearCacheRequest = EmptyObject;
68
69 type OCPP16ConfigurationKey = string | OCPP16StandardParametersKey | OCPP16VendorParametersKey;
70
71 export interface ChangeConfigurationRequest extends JsonObject {
72 key: OCPP16ConfigurationKey;
73 value: string;
74 }
75
76 export interface RemoteStartTransactionRequest extends JsonObject {
77 connectorId: number;
78 idTag: string;
79 chargingProfile?: OCPP16ChargingProfile;
80 }
81
82 export interface RemoteStopTransactionRequest extends JsonObject {
83 transactionId: number;
84 }
85
86 export interface UnlockConnectorRequest extends JsonObject {
87 connectorId: number;
88 }
89
90 export interface GetConfigurationRequest extends JsonObject {
91 key?: OCPP16ConfigurationKey[];
92 }
93
94 enum ResetType {
95 HARD = 'Hard',
96 SOFT = 'Soft',
97 }
98
99 export interface ResetRequest extends JsonObject {
100 type: ResetType;
101 }
102
103 export interface SetChargingProfileRequest extends JsonObject {
104 connectorId: number;
105 csChargingProfiles: OCPP16ChargingProfile;
106 }
107
108 export enum OCPP16AvailabilityType {
109 INOPERATIVE = 'Inoperative',
110 OPERATIVE = 'Operative',
111 }
112
113 export interface ChangeAvailabilityRequest extends JsonObject {
114 connectorId: number;
115 type: OCPP16AvailabilityType;
116 }
117
118 export interface ClearChargingProfileRequest extends JsonObject {
119 id?: number;
120 connectorId?: number;
121 chargingProfilePurpose?: OCPP16ChargingProfilePurposeType;
122 stackLevel?: number;
123 }
124
125 export interface OCPP16UpdateFirmwareRequest extends JsonObject {
126 location: string;
127 retrieveDate: Date;
128 retries?: number;
129 retryInterval?: number;
130 }
131
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;
144 } & JsonObject;
145
146 export interface GetDiagnosticsRequest extends JsonObject {
147 location: string;
148 retries?: number;
149 retryInterval?: number;
150 startTime?: Date;
151 stopTime?: Date;
152 }
153
154 export interface OCPP16DiagnosticsStatusNotificationRequest extends JsonObject {
155 status: OCPP16DiagnosticsStatus;
156 }
157
158 export enum OCPP16MessageTrigger {
159 BootNotification = 'BootNotification',
160 DiagnosticsStatusNotification = 'DiagnosticsStatusNotification',
161 FirmwareStatusNotification = 'FirmwareStatusNotification',
162 Heartbeat = 'Heartbeat',
163 MeterValues = 'MeterValues',
164 StatusNotification = 'StatusNotification',
165 }
166
167 export interface OCPP16TriggerMessageRequest extends JsonObject {
168 requestedMessage: OCPP16MessageTrigger;
169 connectorId?: number;
170 }
171
172 export enum OCPP16DataTransferVendorId {}
173
174 export interface OCPP16DataTransferRequest extends JsonObject {
175 vendorId: string;
176 messageId?: string;
177 data?: string;
178 }