Add initial classes structure for the OCPP 2.0 stack
[e-mobility-charging-stations-simulator.git] / src / types / ocpp / 1.6 / Requests.ts
CommitLineData
6c1761d4
JB
1import type { EmptyObject } from '../../EmptyObject';
2import type { JsonObject } from '../../JsonType';
3import type { OCPP16ChargePointErrorCode } from './ChargePointErrorCode';
4import type { OCPP16ChargePointStatus } from './ChargePointStatus';
5import type { ChargingProfilePurposeType, OCPP16ChargingProfile } from './ChargingProfile';
6import type { OCPP16StandardParametersKey } from './Configuration';
7import type { OCPP16DiagnosticsStatus } from './DiagnosticsStatus';
5bd15d76 8
c0560973 9export 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',
91a7d3ea 18 DATA_TRANSFER = 'DataTransfer',
d9f60ba1
JB
19}
20
953d6b02
JB
21export enum OCPP16IncomingRequestCommand {
22 RESET = 'Reset',
23 CLEAR_CACHE = 'ClearCache',
24 CHANGE_AVAILABILITY = 'ChangeAvailability',
25 UNLOCK_CONNECTOR = 'UnlockConnector',
26 GET_CONFIGURATION = 'GetConfiguration',
27 CHANGE_CONFIGURATION = 'ChangeConfiguration',
28 SET_CHARGING_PROFILE = 'SetChargingProfile',
29 CLEAR_CHARGING_PROFILE = 'ClearChargingProfile',
30 REMOTE_START_TRANSACTION = 'RemoteStartTransaction',
31 REMOTE_STOP_TRANSACTION = 'RemoteStopTransaction',
32 GET_DIAGNOSTICS = 'GetDiagnostics',
33 TRIGGER_MESSAGE = 'TriggerMessage',
34 DATA_TRANSFER = 'DataTransfer',
35 UPDATE_FIRMWARE = 'UpdateFirmware',
36}
37
ef6fa3fb 38export type OCPP16HeartbeatRequest = EmptyObject;
f738a0e9 39
e3822d6f 40export interface OCPP16BootNotificationRequest extends JsonObject {
fec4d204 41 chargePointVendor: string;
f738a0e9
JB
42 chargePointModel: string;
43 chargePointSerialNumber?: string;
fec4d204 44 chargeBoxSerialNumber?: string;
f738a0e9
JB
45 firmwareVersion?: string;
46 iccid?: string;
47 imsi?: string;
f738a0e9 48 meterType?: string;
fec4d204 49 meterSerialNumber?: string;
f738a0e9
JB
50}
51
e3822d6f 52export interface OCPP16StatusNotificationRequest extends JsonObject {
f738a0e9 53 connectorId: number;
c0560973 54 errorCode: OCPP16ChargePointErrorCode;
c0560973 55 status: OCPP16ChargePointStatus;
a9ed42b2 56 info?: string;
f738a0e9
JB
57 timestamp?: string;
58 vendorId?: string;
59 vendorErrorCode?: string;
60}
61
e3018bc4
JB
62export type OCPP16ClearCacheRequest = EmptyObject;
63
e3822d6f 64export interface ChangeConfigurationRequest extends JsonObject {
c0560973 65 key: string | OCPP16StandardParametersKey;
f738a0e9
JB
66 value: string;
67}
68
e3822d6f 69export interface RemoteStartTransactionRequest extends JsonObject {
f738a0e9
JB
70 connectorId: number;
71 idTag: string;
c0560973 72 chargingProfile?: OCPP16ChargingProfile;
f738a0e9
JB
73}
74
e3822d6f 75export interface RemoteStopTransactionRequest extends JsonObject {
f738a0e9
JB
76 transactionId: number;
77}
78
e3822d6f 79export interface UnlockConnectorRequest extends JsonObject {
f738a0e9
JB
80 connectorId: number;
81}
82
e3822d6f 83export interface GetConfigurationRequest extends JsonObject {
c0560973 84 key?: string | OCPP16StandardParametersKey[];
f738a0e9
JB
85}
86
87export enum ResetType {
88 HARD = 'Hard',
e7aeea18 89 SOFT = 'Soft',
f738a0e9
JB
90}
91
e3822d6f 92export interface ResetRequest extends JsonObject {
f738a0e9 93 type: ResetType;
63b48f77 94}
8c476a1f 95
e3822d6f 96export interface SetChargingProfileRequest extends JsonObject {
8c476a1f 97 connectorId: number;
c0560973 98 csChargingProfiles: OCPP16ChargingProfile;
8c476a1f 99}
4dff73b0 100
c0560973 101export enum OCPP16AvailabilityType {
4dff73b0 102 INOPERATIVE = 'Inoperative',
e7aeea18 103 OPERATIVE = 'Operative',
4dff73b0
JB
104}
105
e3822d6f 106export interface ChangeAvailabilityRequest extends JsonObject {
4dff73b0 107 connectorId: number;
c0560973 108 type: OCPP16AvailabilityType;
4dff73b0 109}
edf4bd64 110
e3822d6f 111export interface ClearChargingProfileRequest extends JsonObject {
edf4bd64
JB
112 id?: number;
113 connectorId?: number;
114 chargingProfilePurpose?: ChargingProfilePurposeType;
115 stackLevel?: number;
116}
47e22477 117
b03df580
JB
118export interface OCPP16UpdateFirmwareRequest extends JsonObject {
119 location: string;
120 retrieveDate: Date;
121 retries?: number;
122 retryInterval?: number;
123}
124
e3822d6f 125export interface GetDiagnosticsRequest extends JsonObject {
47e22477
JB
126 location: string;
127 retries?: number;
128 retryInterval?: number;
129 startTime?: Date;
130 stopTime?: Date;
131}
132
e3822d6f 133export interface DiagnosticsStatusNotificationRequest extends JsonObject {
e7aeea18 134 status: OCPP16DiagnosticsStatus;
47e22477 135}
802cfa13 136
c60ed4b8 137export enum OCPP16MessageTrigger {
802cfa13
JB
138 BootNotification = 'BootNotification',
139 DiagnosticsStatusNotification = 'DiagnosticsStatusNotification',
140 FirmwareStatusNotification = 'FirmwareStatusNotification',
141 Heartbeat = 'Heartbeat',
142 MeterValues = 'MeterValues',
e7aeea18 143 StatusNotification = 'StatusNotification',
802cfa13
JB
144}
145
e3822d6f 146export interface OCPP16TriggerMessageRequest extends JsonObject {
c60ed4b8 147 requestedMessage: OCPP16MessageTrigger;
e7aeea18 148 connectorId?: number;
802cfa13 149}
91a7d3ea 150
77b95a89
JB
151export enum OCPP16DataTransferVendorId {}
152
91a7d3ea
JB
153export interface OCPP16DataTransferRequest extends JsonObject {
154 vendorId: string;
155 messageId?: string;
156 data?: string;
157}