Add OCPP DataTransfer request support
[e-mobility-charging-stations-simulator.git] / src / types / ocpp / 1.6 / Requests.ts
CommitLineData
6c1761d4
JB
1import type { EmptyObject } from '../../EmptyObject';
2import type { JsonObject } from '../../JsonType';
3import type { OCPP16ChargePointErrorCode } from './ChargePointErrorCode';
4import type { OCPP16ChargePointStatus } from './ChargePointStatus';
5import type { ChargingProfilePurposeType, OCPP16ChargingProfile } from './ChargingProfile';
6import type { OCPP16StandardParametersKey } from './Configuration';
7import type { OCPP16DiagnosticsStatus } from './DiagnosticsStatus';
5bd15d76 8
c0560973 9export enum OCPP16RequestCommand {
d9f60ba1
JB
10 BOOT_NOTIFICATION = 'BootNotification',
11 HEARTBEAT = 'Heartbeat',
12 STATUS_NOTIFICATION = 'StatusNotification',
ef6076c1 13 AUTHORIZE = 'Authorize',
d9f60ba1
JB
14 START_TRANSACTION = 'StartTransaction',
15 STOP_TRANSACTION = 'StopTransaction',
47e22477 16 METER_VALUES = 'MeterValues',
e7aeea18 17 DIAGNOSTICS_STATUS_NOTIFICATION = 'DiagnosticsStatusNotification',
91a7d3ea 18 DATA_TRANSFER = 'DataTransfer',
d9f60ba1
JB
19}
20
ef6fa3fb 21export type OCPP16HeartbeatRequest = EmptyObject;
f738a0e9 22
e3822d6f 23export interface OCPP16BootNotificationRequest extends JsonObject {
fec4d204 24 chargePointVendor: string;
f738a0e9
JB
25 chargePointModel: string;
26 chargePointSerialNumber?: string;
fec4d204 27 chargeBoxSerialNumber?: string;
f738a0e9
JB
28 firmwareVersion?: string;
29 iccid?: string;
30 imsi?: string;
f738a0e9 31 meterType?: string;
fec4d204 32 meterSerialNumber?: string;
f738a0e9
JB
33}
34
e3822d6f 35export interface OCPP16StatusNotificationRequest extends JsonObject {
f738a0e9 36 connectorId: number;
c0560973 37 errorCode: OCPP16ChargePointErrorCode;
c0560973 38 status: OCPP16ChargePointStatus;
a9ed42b2 39 info?: string;
f738a0e9
JB
40 timestamp?: string;
41 vendorId?: string;
42 vendorErrorCode?: string;
43}
44
e3018bc4
JB
45export 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}
59
60export type OCPP16ClearCacheRequest = EmptyObject;
61
e3822d6f 62export interface ChangeConfigurationRequest extends JsonObject {
c0560973 63 key: string | OCPP16StandardParametersKey;
f738a0e9
JB
64 value: string;
65}
66
e3822d6f 67export interface RemoteStartTransactionRequest extends JsonObject {
f738a0e9
JB
68 connectorId: number;
69 idTag: string;
c0560973 70 chargingProfile?: OCPP16ChargingProfile;
f738a0e9
JB
71}
72
e3822d6f 73export interface RemoteStopTransactionRequest extends JsonObject {
f738a0e9
JB
74 transactionId: number;
75}
76
e3822d6f 77export interface UnlockConnectorRequest extends JsonObject {
f738a0e9
JB
78 connectorId: number;
79}
80
e3822d6f 81export interface GetConfigurationRequest extends JsonObject {
c0560973 82 key?: string | OCPP16StandardParametersKey[];
f738a0e9
JB
83}
84
85export enum ResetType {
86 HARD = 'Hard',
e7aeea18 87 SOFT = 'Soft',
f738a0e9
JB
88}
89
e3822d6f 90export interface ResetRequest extends JsonObject {
f738a0e9 91 type: ResetType;
63b48f77 92}
8c476a1f 93
e3822d6f 94export interface SetChargingProfileRequest extends JsonObject {
8c476a1f 95 connectorId: number;
c0560973 96 csChargingProfiles: OCPP16ChargingProfile;
8c476a1f 97}
4dff73b0 98
c0560973 99export enum OCPP16AvailabilityType {
4dff73b0 100 INOPERATIVE = 'Inoperative',
e7aeea18 101 OPERATIVE = 'Operative',
4dff73b0
JB
102}
103
e3822d6f 104export interface ChangeAvailabilityRequest extends JsonObject {
4dff73b0 105 connectorId: number;
c0560973 106 type: OCPP16AvailabilityType;
4dff73b0 107}
edf4bd64 108
e3822d6f 109export interface ClearChargingProfileRequest extends JsonObject {
edf4bd64
JB
110 id?: number;
111 connectorId?: number;
112 chargingProfilePurpose?: ChargingProfilePurposeType;
113 stackLevel?: number;
114}
47e22477 115
e3822d6f 116export interface GetDiagnosticsRequest extends JsonObject {
47e22477
JB
117 location: string;
118 retries?: number;
119 retryInterval?: number;
120 startTime?: Date;
121 stopTime?: Date;
122}
123
e3822d6f 124export interface DiagnosticsStatusNotificationRequest extends JsonObject {
e7aeea18 125 status: OCPP16DiagnosticsStatus;
47e22477 126}
802cfa13 127
c60ed4b8 128export enum OCPP16MessageTrigger {
802cfa13
JB
129 BootNotification = 'BootNotification',
130 DiagnosticsStatusNotification = 'DiagnosticsStatusNotification',
131 FirmwareStatusNotification = 'FirmwareStatusNotification',
132 Heartbeat = 'Heartbeat',
133 MeterValues = 'MeterValues',
e7aeea18 134 StatusNotification = 'StatusNotification',
802cfa13
JB
135}
136
e3822d6f 137export interface OCPP16TriggerMessageRequest extends JsonObject {
c60ed4b8 138 requestedMessage: OCPP16MessageTrigger;
e7aeea18 139 connectorId?: number;
802cfa13 140}
91a7d3ea
JB
141
142export interface OCPP16DataTransferRequest extends JsonObject {
143 vendorId: string;
144 messageId?: string;
145 data?: string;
146}