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