20d1e4498bccc65ca403e5153a6a2f749d69e4d8
[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 type OCPP16HeartbeatRequest = EmptyObject;
22
23 export interface OCPP16BootNotificationRequest extends JsonObject {
24 chargePointVendor: string;
25 chargePointModel: string;
26 chargePointSerialNumber?: string;
27 chargeBoxSerialNumber?: string;
28 firmwareVersion?: string;
29 iccid?: string;
30 imsi?: string;
31 meterType?: string;
32 meterSerialNumber?: string;
33 }
34
35 export interface OCPP16StatusNotificationRequest extends JsonObject {
36 connectorId: number;
37 errorCode: OCPP16ChargePointErrorCode;
38 status: OCPP16ChargePointStatus;
39 info?: string;
40 timestamp?: string;
41 vendorId?: string;
42 vendorErrorCode?: string;
43 }
44
45 export enum OCPP16IncomingRequestCommand {
46 RESET = 'Reset',
47 CLEAR_CACHE = 'ClearCache',
48 CHANGE_AVAILABILITY = 'ChangeAvailability',
49 UNLOCK_CONNECTOR = 'UnlockConnector',
50 GET_CONFIGURATION = 'GetConfiguration',
51 CHANGE_CONFIGURATION = 'ChangeConfiguration',
52 SET_CHARGING_PROFILE = 'SetChargingProfile',
53 CLEAR_CHARGING_PROFILE = 'ClearChargingProfile',
54 REMOTE_START_TRANSACTION = 'RemoteStartTransaction',
55 REMOTE_STOP_TRANSACTION = 'RemoteStopTransaction',
56 GET_DIAGNOSTICS = 'GetDiagnostics',
57 TRIGGER_MESSAGE = 'TriggerMessage',
58 DATA_TRANSFER = 'DataTransfer',
59 UPDATE_FIRMWARE = 'UpdateFirmware',
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 }