Add GetDiagnostics command support
[e-mobility-charging-stations-simulator.git] / src / types / ocpp / 1.6 / Requests.ts
CommitLineData
c0560973 1import { ChargingProfilePurposeType, OCPP16ChargingProfile } from './ChargingProfile';
edf4bd64 2
c0560973
JB
3import { OCPP16ChargePointErrorCode } from './ChargePointErrorCode';
4import { OCPP16ChargePointStatus } from './ChargePointStatus';
47e22477 5import { OCPP16DiagnosticsStatus } from './DiagnosticsStatus';
c0560973 6import { OCPP16StandardParametersKey } from './Configuration';
5bd15d76 7
c0560973 8export enum OCPP16RequestCommand {
d9f60ba1
JB
9 BOOT_NOTIFICATION = 'BootNotification',
10 HEARTBEAT = 'Heartbeat',
11 STATUS_NOTIFICATION = 'StatusNotification',
12 CHANGE_CONFIGURATION = 'ChangeConfiguration',
ef6076c1 13 AUTHORIZE = 'Authorize',
d9f60ba1
JB
14 START_TRANSACTION = 'StartTransaction',
15 STOP_TRANSACTION = 'StopTransaction',
47e22477
JB
16 METER_VALUES = 'MeterValues',
17 DIAGNOSTICS_STATUS_NOTIFICATION= 'DiagnosticsStatusNotification'
d9f60ba1
JB
18}
19
c0560973 20export enum OCPP16IncomingRequestCommand {
d9f60ba1
JB
21 RESET = 'Reset',
22 CLEAR_CACHE = 'ClearCache',
4dff73b0 23 CHANGE_AVAILABILITY = 'ChangeAvailability',
d9f60ba1
JB
24 UNLOCK_CONNECTOR = 'UnlockConnector',
25 GET_CONFIGURATION = 'GetConfiguration',
26 CHANGE_CONFIGURATION = 'ChangeConfiguration',
27 SET_CHARGING_PROFILE = 'SetChargingProfile',
edf4bd64 28 CLEAR_CHARGING_PROFILE = 'ClearChargingProfile',
d9f60ba1 29 REMOTE_START_TRANSACTION = 'RemoteStartTransaction',
47e22477
JB
30 REMOTE_STOP_TRANSACTION = 'RemoteStopTransaction',
31 GET_DIAGNOSTICS = 'GetDiagnostics'
d9f60ba1
JB
32}
33
f738a0e9 34// eslint-disable-next-line @typescript-eslint/no-empty-interface
d0641efa 35export interface HeartbeatRequest { }
f738a0e9 36
c0560973 37export interface OCPP16BootNotificationRequest {
f738a0e9
JB
38 chargeBoxSerialNumber?: string;
39 chargePointModel: string;
40 chargePointSerialNumber?: string;
41 chargePointVendor: string;
42 firmwareVersion?: string;
43 iccid?: string;
44 imsi?: string;
45 meterSerialNumber?: string;
46 meterType?: string;
47}
48
49export interface StatusNotificationRequest {
50 connectorId: number;
c0560973 51 errorCode: OCPP16ChargePointErrorCode;
f738a0e9 52 info?: string;
c0560973 53 status: OCPP16ChargePointStatus;
f738a0e9
JB
54 timestamp?: string;
55 vendorId?: string;
56 vendorErrorCode?: string;
57}
58
59export interface ChangeConfigurationRequest {
c0560973 60 key: string | OCPP16StandardParametersKey;
f738a0e9
JB
61 value: string;
62}
63
64export interface RemoteStartTransactionRequest {
65 connectorId: number;
66 idTag: string;
c0560973 67 chargingProfile?: OCPP16ChargingProfile;
f738a0e9
JB
68}
69
70export interface RemoteStopTransactionRequest {
71 transactionId: number;
72}
73
74export interface UnlockConnectorRequest {
75 connectorId: number;
76}
77
78export interface GetConfigurationRequest {
c0560973 79 key?: string | OCPP16StandardParametersKey[];
f738a0e9
JB
80}
81
82export enum ResetType {
83 HARD = 'Hard',
84 SOFT = 'Soft'
85}
86
87export interface ResetRequest {
88 type: ResetType;
63b48f77 89}
8c476a1f
JB
90
91export interface SetChargingProfileRequest {
92 connectorId: number;
c0560973 93 csChargingProfiles: OCPP16ChargingProfile;
8c476a1f 94}
4dff73b0 95
c0560973 96export enum OCPP16AvailabilityType {
4dff73b0
JB
97 INOPERATIVE = 'Inoperative',
98 OPERATIVE = 'Operative'
99}
100
101export interface ChangeAvailabilityRequest {
102 connectorId: number;
c0560973 103 type: OCPP16AvailabilityType;
4dff73b0 104}
edf4bd64
JB
105
106export interface ClearChargingProfileRequest {
107 id?: number;
108 connectorId?: number;
109 chargingProfilePurpose?: ChargingProfilePurposeType;
110 stackLevel?: number;
111}
47e22477
JB
112
113export interface GetDiagnosticsRequest {
114 location: string;
115 retries?: number;
116 retryInterval?: number;
117 startTime?: Date;
118 stopTime?: Date;
119}
120
121export interface DiagnosticsStatusNotificationRequest {
122 status: OCPP16DiagnosticsStatus
123}