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