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