Commit | Line | Data |
---|---|---|
6c1761d4 JB |
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'; | |
5bd15d76 | 8 | |
c0560973 | 9 | export 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 | ||
953d6b02 JB |
21 | export enum OCPP16IncomingRequestCommand { |
22 | RESET = 'Reset', | |
23 | CLEAR_CACHE = 'ClearCache', | |
24 | CHANGE_AVAILABILITY = 'ChangeAvailability', | |
25 | UNLOCK_CONNECTOR = 'UnlockConnector', | |
26 | GET_CONFIGURATION = 'GetConfiguration', | |
27 | CHANGE_CONFIGURATION = 'ChangeConfiguration', | |
28 | SET_CHARGING_PROFILE = 'SetChargingProfile', | |
29 | CLEAR_CHARGING_PROFILE = 'ClearChargingProfile', | |
30 | REMOTE_START_TRANSACTION = 'RemoteStartTransaction', | |
31 | REMOTE_STOP_TRANSACTION = 'RemoteStopTransaction', | |
32 | GET_DIAGNOSTICS = 'GetDiagnostics', | |
33 | TRIGGER_MESSAGE = 'TriggerMessage', | |
34 | DATA_TRANSFER = 'DataTransfer', | |
35 | UPDATE_FIRMWARE = 'UpdateFirmware', | |
36 | } | |
37 | ||
ef6fa3fb | 38 | export type OCPP16HeartbeatRequest = EmptyObject; |
f738a0e9 | 39 | |
e3822d6f | 40 | export interface OCPP16BootNotificationRequest extends JsonObject { |
fec4d204 | 41 | chargePointVendor: string; |
f738a0e9 JB |
42 | chargePointModel: string; |
43 | chargePointSerialNumber?: string; | |
fec4d204 | 44 | chargeBoxSerialNumber?: string; |
f738a0e9 JB |
45 | firmwareVersion?: string; |
46 | iccid?: string; | |
47 | imsi?: string; | |
f738a0e9 | 48 | meterType?: string; |
fec4d204 | 49 | meterSerialNumber?: string; |
f738a0e9 JB |
50 | } |
51 | ||
e3822d6f | 52 | export interface OCPP16StatusNotificationRequest extends JsonObject { |
f738a0e9 | 53 | connectorId: number; |
c0560973 | 54 | errorCode: OCPP16ChargePointErrorCode; |
c0560973 | 55 | status: OCPP16ChargePointStatus; |
a9ed42b2 | 56 | info?: string; |
f738a0e9 JB |
57 | timestamp?: string; |
58 | vendorId?: string; | |
59 | vendorErrorCode?: string; | |
60 | } | |
61 | ||
e3018bc4 JB |
62 | export type OCPP16ClearCacheRequest = EmptyObject; |
63 | ||
e3822d6f | 64 | export interface ChangeConfigurationRequest extends JsonObject { |
c0560973 | 65 | key: string | OCPP16StandardParametersKey; |
f738a0e9 JB |
66 | value: string; |
67 | } | |
68 | ||
e3822d6f | 69 | export interface RemoteStartTransactionRequest extends JsonObject { |
f738a0e9 JB |
70 | connectorId: number; |
71 | idTag: string; | |
c0560973 | 72 | chargingProfile?: OCPP16ChargingProfile; |
f738a0e9 JB |
73 | } |
74 | ||
e3822d6f | 75 | export interface RemoteStopTransactionRequest extends JsonObject { |
f738a0e9 JB |
76 | transactionId: number; |
77 | } | |
78 | ||
e3822d6f | 79 | export interface UnlockConnectorRequest extends JsonObject { |
f738a0e9 JB |
80 | connectorId: number; |
81 | } | |
82 | ||
e3822d6f | 83 | export interface GetConfigurationRequest extends JsonObject { |
c0560973 | 84 | key?: string | OCPP16StandardParametersKey[]; |
f738a0e9 JB |
85 | } |
86 | ||
87 | export enum ResetType { | |
88 | HARD = 'Hard', | |
e7aeea18 | 89 | SOFT = 'Soft', |
f738a0e9 JB |
90 | } |
91 | ||
e3822d6f | 92 | export interface ResetRequest extends JsonObject { |
f738a0e9 | 93 | type: ResetType; |
63b48f77 | 94 | } |
8c476a1f | 95 | |
e3822d6f | 96 | export interface SetChargingProfileRequest extends JsonObject { |
8c476a1f | 97 | connectorId: number; |
c0560973 | 98 | csChargingProfiles: OCPP16ChargingProfile; |
8c476a1f | 99 | } |
4dff73b0 | 100 | |
c0560973 | 101 | export enum OCPP16AvailabilityType { |
4dff73b0 | 102 | INOPERATIVE = 'Inoperative', |
e7aeea18 | 103 | OPERATIVE = 'Operative', |
4dff73b0 JB |
104 | } |
105 | ||
e3822d6f | 106 | export interface ChangeAvailabilityRequest extends JsonObject { |
4dff73b0 | 107 | connectorId: number; |
c0560973 | 108 | type: OCPP16AvailabilityType; |
4dff73b0 | 109 | } |
edf4bd64 | 110 | |
e3822d6f | 111 | export interface ClearChargingProfileRequest extends JsonObject { |
edf4bd64 JB |
112 | id?: number; |
113 | connectorId?: number; | |
114 | chargingProfilePurpose?: ChargingProfilePurposeType; | |
115 | stackLevel?: number; | |
116 | } | |
47e22477 | 117 | |
b03df580 JB |
118 | export interface OCPP16UpdateFirmwareRequest extends JsonObject { |
119 | location: string; | |
120 | retrieveDate: Date; | |
121 | retries?: number; | |
122 | retryInterval?: number; | |
123 | } | |
124 | ||
e3822d6f | 125 | export interface GetDiagnosticsRequest extends JsonObject { |
47e22477 JB |
126 | location: string; |
127 | retries?: number; | |
128 | retryInterval?: number; | |
129 | startTime?: Date; | |
130 | stopTime?: Date; | |
131 | } | |
132 | ||
e3822d6f | 133 | export interface DiagnosticsStatusNotificationRequest extends JsonObject { |
e7aeea18 | 134 | status: OCPP16DiagnosticsStatus; |
47e22477 | 135 | } |
802cfa13 | 136 | |
c60ed4b8 | 137 | export enum OCPP16MessageTrigger { |
802cfa13 JB |
138 | BootNotification = 'BootNotification', |
139 | DiagnosticsStatusNotification = 'DiagnosticsStatusNotification', | |
140 | FirmwareStatusNotification = 'FirmwareStatusNotification', | |
141 | Heartbeat = 'Heartbeat', | |
142 | MeterValues = 'MeterValues', | |
e7aeea18 | 143 | StatusNotification = 'StatusNotification', |
802cfa13 JB |
144 | } |
145 | ||
e3822d6f | 146 | export interface OCPP16TriggerMessageRequest extends JsonObject { |
c60ed4b8 | 147 | requestedMessage: OCPP16MessageTrigger; |
e7aeea18 | 148 | connectorId?: number; |
802cfa13 | 149 | } |
91a7d3ea | 150 | |
77b95a89 JB |
151 | export enum OCPP16DataTransferVendorId {} |
152 | ||
91a7d3ea JB |
153 | export interface OCPP16DataTransferRequest extends JsonObject { |
154 | vendorId: string; | |
155 | messageId?: string; | |
156 | data?: string; | |
157 | } |