Use eslint extension for import sorting instead of unmaintained external ones
[e-mobility-charging-stations-simulator.git] / src / types / ocpp / 1.6 / Requests.ts
... / ...
CommitLineData
1import { EmptyObject } from '../../EmptyObject';
2import { JsonObject } from '../../JsonType';
3import { OCPP16ChargePointErrorCode } from './ChargePointErrorCode';
4import { OCPP16ChargePointStatus } from './ChargePointStatus';
5import { ChargingProfilePurposeType, OCPP16ChargingProfile } from './ChargingProfile';
6import { OCPP16StandardParametersKey } from './Configuration';
7import { OCPP16DiagnosticsStatus } from './DiagnosticsStatus';
8
9export 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}
19
20export enum OCPP16IncomingRequestCommand {
21 RESET = 'Reset',
22 CLEAR_CACHE = 'ClearCache',
23 CHANGE_AVAILABILITY = 'ChangeAvailability',
24 UNLOCK_CONNECTOR = 'UnlockConnector',
25 GET_CONFIGURATION = 'GetConfiguration',
26 CHANGE_CONFIGURATION = 'ChangeConfiguration',
27 SET_CHARGING_PROFILE = 'SetChargingProfile',
28 CLEAR_CHARGING_PROFILE = 'ClearChargingProfile',
29 REMOTE_START_TRANSACTION = 'RemoteStartTransaction',
30 REMOTE_STOP_TRANSACTION = 'RemoteStopTransaction',
31 GET_DIAGNOSTICS = 'GetDiagnostics',
32 TRIGGER_MESSAGE = 'TriggerMessage',
33}
34
35export type OCPP16HeartbeatRequest = EmptyObject;
36
37export interface OCPP16BootNotificationRequest extends JsonObject {
38 chargePointVendor: string;
39 chargePointModel: string;
40 chargePointSerialNumber?: string;
41 chargeBoxSerialNumber?: string;
42 firmwareVersion?: string;
43 iccid?: string;
44 imsi?: string;
45 meterType?: string;
46 meterSerialNumber?: string;
47}
48
49export interface OCPP16StatusNotificationRequest extends JsonObject {
50 connectorId: number;
51 errorCode: OCPP16ChargePointErrorCode;
52 info?: string;
53 status: OCPP16ChargePointStatus;
54 timestamp?: string;
55 vendorId?: string;
56 vendorErrorCode?: string;
57}
58
59export interface ChangeConfigurationRequest extends JsonObject {
60 key: string | OCPP16StandardParametersKey;
61 value: string;
62}
63
64export interface RemoteStartTransactionRequest extends JsonObject {
65 connectorId: number;
66 idTag: string;
67 chargingProfile?: OCPP16ChargingProfile;
68}
69
70export interface RemoteStopTransactionRequest extends JsonObject {
71 transactionId: number;
72}
73
74export interface UnlockConnectorRequest extends JsonObject {
75 connectorId: number;
76}
77
78export interface GetConfigurationRequest extends JsonObject {
79 key?: string | OCPP16StandardParametersKey[];
80}
81
82export enum ResetType {
83 HARD = 'Hard',
84 SOFT = 'Soft',
85}
86
87export interface ResetRequest extends JsonObject {
88 type: ResetType;
89}
90
91export interface SetChargingProfileRequest extends JsonObject {
92 connectorId: number;
93 csChargingProfiles: OCPP16ChargingProfile;
94}
95
96export enum OCPP16AvailabilityType {
97 INOPERATIVE = 'Inoperative',
98 OPERATIVE = 'Operative',
99}
100
101export interface ChangeAvailabilityRequest extends JsonObject {
102 connectorId: number;
103 type: OCPP16AvailabilityType;
104}
105
106export interface ClearChargingProfileRequest extends JsonObject {
107 id?: number;
108 connectorId?: number;
109 chargingProfilePurpose?: ChargingProfilePurposeType;
110 stackLevel?: number;
111}
112
113export interface GetDiagnosticsRequest extends JsonObject {
114 location: string;
115 retries?: number;
116 retryInterval?: number;
117 startTime?: Date;
118 stopTime?: Date;
119}
120
121export interface DiagnosticsStatusNotificationRequest extends JsonObject {
122 status: OCPP16DiagnosticsStatus;
123}
124
125export enum MessageTrigger {
126 BootNotification = 'BootNotification',
127 DiagnosticsStatusNotification = 'DiagnosticsStatusNotification',
128 FirmwareStatusNotification = 'FirmwareStatusNotification',
129 Heartbeat = 'Heartbeat',
130 MeterValues = 'MeterValues',
131 StatusNotification = 'StatusNotification',
132}
133
134export interface OCPP16TriggerMessageRequest extends JsonObject {
135 requestedMessage: MessageTrigger;
136 connectorId?: number;
137}