Commit | Line | Data |
---|---|---|
c12b43d0 | 1 | import { EmptyObject } from '../../EmptyObject'; |
e3822d6f | 2 | import { JsonObject } from '../../JsonType'; |
c0560973 JB |
3 | import { OCPP16ChargePointErrorCode } from './ChargePointErrorCode'; |
4 | import { OCPP16ChargePointStatus } from './ChargePointStatus'; | |
8114d10e | 5 | import { ChargingProfilePurposeType, OCPP16ChargingProfile } from './ChargingProfile'; |
c0560973 | 6 | import { OCPP16StandardParametersKey } from './Configuration'; |
8114d10e | 7 | import { 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', |
d9f60ba1 JB |
18 | } |
19 | ||
ef6fa3fb | 20 | export type OCPP16HeartbeatRequest = EmptyObject; |
f738a0e9 | 21 | |
e3822d6f | 22 | export interface OCPP16BootNotificationRequest extends JsonObject { |
fec4d204 | 23 | chargePointVendor: string; |
f738a0e9 JB |
24 | chargePointModel: string; |
25 | chargePointSerialNumber?: string; | |
fec4d204 | 26 | chargeBoxSerialNumber?: string; |
f738a0e9 JB |
27 | firmwareVersion?: string; |
28 | iccid?: string; | |
29 | imsi?: string; | |
f738a0e9 | 30 | meterType?: string; |
fec4d204 | 31 | meterSerialNumber?: string; |
f738a0e9 JB |
32 | } |
33 | ||
e3822d6f | 34 | export interface OCPP16StatusNotificationRequest extends JsonObject { |
f738a0e9 | 35 | connectorId: number; |
c0560973 | 36 | errorCode: OCPP16ChargePointErrorCode; |
f738a0e9 | 37 | info?: string; |
c0560973 | 38 | status: OCPP16ChargePointStatus; |
f738a0e9 JB |
39 | timestamp?: string; |
40 | vendorId?: string; | |
41 | vendorErrorCode?: string; | |
42 | } | |
43 | ||
e3018bc4 JB |
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 | ||
e3822d6f | 61 | export interface ChangeConfigurationRequest extends JsonObject { |
c0560973 | 62 | key: string | OCPP16StandardParametersKey; |
f738a0e9 JB |
63 | value: string; |
64 | } | |
65 | ||
e3822d6f | 66 | export interface RemoteStartTransactionRequest extends JsonObject { |
f738a0e9 JB |
67 | connectorId: number; |
68 | idTag: string; | |
c0560973 | 69 | chargingProfile?: OCPP16ChargingProfile; |
f738a0e9 JB |
70 | } |
71 | ||
e3822d6f | 72 | export interface RemoteStopTransactionRequest extends JsonObject { |
f738a0e9 JB |
73 | transactionId: number; |
74 | } | |
75 | ||
e3822d6f | 76 | export interface UnlockConnectorRequest extends JsonObject { |
f738a0e9 JB |
77 | connectorId: number; |
78 | } | |
79 | ||
e3822d6f | 80 | export interface GetConfigurationRequest extends JsonObject { |
c0560973 | 81 | key?: string | OCPP16StandardParametersKey[]; |
f738a0e9 JB |
82 | } |
83 | ||
84 | export enum ResetType { | |
85 | HARD = 'Hard', | |
e7aeea18 | 86 | SOFT = 'Soft', |
f738a0e9 JB |
87 | } |
88 | ||
e3822d6f | 89 | export interface ResetRequest extends JsonObject { |
f738a0e9 | 90 | type: ResetType; |
63b48f77 | 91 | } |
8c476a1f | 92 | |
e3822d6f | 93 | export interface SetChargingProfileRequest extends JsonObject { |
8c476a1f | 94 | connectorId: number; |
c0560973 | 95 | csChargingProfiles: OCPP16ChargingProfile; |
8c476a1f | 96 | } |
4dff73b0 | 97 | |
c0560973 | 98 | export enum OCPP16AvailabilityType { |
4dff73b0 | 99 | INOPERATIVE = 'Inoperative', |
e7aeea18 | 100 | OPERATIVE = 'Operative', |
4dff73b0 JB |
101 | } |
102 | ||
e3822d6f | 103 | export interface ChangeAvailabilityRequest extends JsonObject { |
4dff73b0 | 104 | connectorId: number; |
c0560973 | 105 | type: OCPP16AvailabilityType; |
4dff73b0 | 106 | } |
edf4bd64 | 107 | |
e3822d6f | 108 | export interface ClearChargingProfileRequest extends JsonObject { |
edf4bd64 JB |
109 | id?: number; |
110 | connectorId?: number; | |
111 | chargingProfilePurpose?: ChargingProfilePurposeType; | |
112 | stackLevel?: number; | |
113 | } | |
47e22477 | 114 | |
e3822d6f | 115 | export interface GetDiagnosticsRequest extends JsonObject { |
47e22477 JB |
116 | location: string; |
117 | retries?: number; | |
118 | retryInterval?: number; | |
119 | startTime?: Date; | |
120 | stopTime?: Date; | |
121 | } | |
122 | ||
e3822d6f | 123 | export interface DiagnosticsStatusNotificationRequest extends JsonObject { |
e7aeea18 | 124 | status: OCPP16DiagnosticsStatus; |
47e22477 | 125 | } |
802cfa13 JB |
126 | |
127 | export enum MessageTrigger { | |
128 | BootNotification = 'BootNotification', | |
129 | DiagnosticsStatusNotification = 'DiagnosticsStatusNotification', | |
130 | FirmwareStatusNotification = 'FirmwareStatusNotification', | |
131 | Heartbeat = 'Heartbeat', | |
132 | MeterValues = 'MeterValues', | |
e7aeea18 | 133 | StatusNotification = 'StatusNotification', |
802cfa13 JB |
134 | } |
135 | ||
e3822d6f | 136 | export interface OCPP16TriggerMessageRequest extends JsonObject { |
802cfa13 | 137 | requestedMessage: MessageTrigger; |
e7aeea18 | 138 | connectorId?: number; |
802cfa13 | 139 | } |