97dccc1e1480418bb4f8740be23da78252be953b
[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 DATA_TRANSFER = 'DataTransfer',
19 }
20
21 export 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
38 export type OCPP16HeartbeatRequest = EmptyObject;
39
40 export interface OCPP16BootNotificationRequest extends JsonObject {
41 chargePointVendor: string;
42 chargePointModel: string;
43 chargePointSerialNumber?: string;
44 chargeBoxSerialNumber?: string;
45 firmwareVersion?: string;
46 iccid?: string;
47 imsi?: string;
48 meterType?: string;
49 meterSerialNumber?: string;
50 }
51
52 export interface OCPP16StatusNotificationRequest extends JsonObject {
53 connectorId: number;
54 errorCode: OCPP16ChargePointErrorCode;
55 status: OCPP16ChargePointStatus;
56 info?: string;
57 timestamp?: string;
58 vendorId?: string;
59 vendorErrorCode?: string;
60 }
61
62 export type OCPP16ClearCacheRequest = EmptyObject;
63
64 export interface ChangeConfigurationRequest extends JsonObject {
65 key: string | OCPP16StandardParametersKey;
66 value: string;
67 }
68
69 export interface RemoteStartTransactionRequest extends JsonObject {
70 connectorId: number;
71 idTag: string;
72 chargingProfile?: OCPP16ChargingProfile;
73 }
74
75 export interface RemoteStopTransactionRequest extends JsonObject {
76 transactionId: number;
77 }
78
79 export interface UnlockConnectorRequest extends JsonObject {
80 connectorId: number;
81 }
82
83 export interface GetConfigurationRequest extends JsonObject {
84 key?: string | OCPP16StandardParametersKey[];
85 }
86
87 export enum ResetType {
88 HARD = 'Hard',
89 SOFT = 'Soft',
90 }
91
92 export interface ResetRequest extends JsonObject {
93 type: ResetType;
94 }
95
96 export interface SetChargingProfileRequest extends JsonObject {
97 connectorId: number;
98 csChargingProfiles: OCPP16ChargingProfile;
99 }
100
101 export enum OCPP16AvailabilityType {
102 INOPERATIVE = 'Inoperative',
103 OPERATIVE = 'Operative',
104 }
105
106 export interface ChangeAvailabilityRequest extends JsonObject {
107 connectorId: number;
108 type: OCPP16AvailabilityType;
109 }
110
111 export interface ClearChargingProfileRequest extends JsonObject {
112 id?: number;
113 connectorId?: number;
114 chargingProfilePurpose?: ChargingProfilePurposeType;
115 stackLevel?: number;
116 }
117
118 export interface OCPP16UpdateFirmwareRequest extends JsonObject {
119 location: string;
120 retrieveDate: Date;
121 retries?: number;
122 retryInterval?: number;
123 }
124
125 export interface GetDiagnosticsRequest extends JsonObject {
126 location: string;
127 retries?: number;
128 retryInterval?: number;
129 startTime?: Date;
130 stopTime?: Date;
131 }
132
133 export interface DiagnosticsStatusNotificationRequest extends JsonObject {
134 status: OCPP16DiagnosticsStatus;
135 }
136
137 export enum OCPP16MessageTrigger {
138 BootNotification = 'BootNotification',
139 DiagnosticsStatusNotification = 'DiagnosticsStatusNotification',
140 FirmwareStatusNotification = 'FirmwareStatusNotification',
141 Heartbeat = 'Heartbeat',
142 MeterValues = 'MeterValues',
143 StatusNotification = 'StatusNotification',
144 }
145
146 export interface OCPP16TriggerMessageRequest extends JsonObject {
147 requestedMessage: OCPP16MessageTrigger;
148 connectorId?: number;
149 }
150
151 export enum OCPP16DataTransferVendorId {}
152
153 export interface OCPP16DataTransferRequest extends JsonObject {
154 vendorId: string;
155 messageId?: string;
156 data?: string;
157 }