| 1 | import { ChargingProfilePurposeType, OCPP16ChargingProfile } from './ChargingProfile'; |
| 2 | |
| 3 | import { EmptyObject } from '../../EmptyObject'; |
| 4 | import { JsonObject } from '../../JsonType'; |
| 5 | import { OCPP16ChargePointErrorCode } from './ChargePointErrorCode'; |
| 6 | import { OCPP16ChargePointStatus } from './ChargePointStatus'; |
| 7 | import { OCPP16DiagnosticsStatus } from './DiagnosticsStatus'; |
| 8 | import { OCPP16StandardParametersKey } from './Configuration'; |
| 9 | |
| 10 | export enum OCPP16RequestCommand { |
| 11 | BOOT_NOTIFICATION = 'BootNotification', |
| 12 | HEARTBEAT = 'Heartbeat', |
| 13 | STATUS_NOTIFICATION = 'StatusNotification', |
| 14 | AUTHORIZE = 'Authorize', |
| 15 | START_TRANSACTION = 'StartTransaction', |
| 16 | STOP_TRANSACTION = 'StopTransaction', |
| 17 | METER_VALUES = 'MeterValues', |
| 18 | DIAGNOSTICS_STATUS_NOTIFICATION = 'DiagnosticsStatusNotification', |
| 19 | } |
| 20 | |
| 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 | } |
| 35 | |
| 36 | export type OCPP16HeartbeatRequest = EmptyObject; |
| 37 | |
| 38 | export interface OCPP16BootNotificationRequest extends JsonObject { |
| 39 | chargePointVendor: string; |
| 40 | chargePointModel: string; |
| 41 | chargePointSerialNumber?: string; |
| 42 | chargeBoxSerialNumber?: string; |
| 43 | firmwareVersion?: string; |
| 44 | iccid?: string; |
| 45 | imsi?: string; |
| 46 | meterType?: string; |
| 47 | meterSerialNumber?: string; |
| 48 | } |
| 49 | |
| 50 | export interface OCPP16StatusNotificationRequest extends JsonObject { |
| 51 | connectorId: number; |
| 52 | errorCode: OCPP16ChargePointErrorCode; |
| 53 | info?: string; |
| 54 | status: OCPP16ChargePointStatus; |
| 55 | timestamp?: string; |
| 56 | vendorId?: string; |
| 57 | vendorErrorCode?: string; |
| 58 | } |
| 59 | |
| 60 | export interface ChangeConfigurationRequest extends JsonObject { |
| 61 | key: string | OCPP16StandardParametersKey; |
| 62 | value: string; |
| 63 | } |
| 64 | |
| 65 | export interface RemoteStartTransactionRequest extends JsonObject { |
| 66 | connectorId: number; |
| 67 | idTag: string; |
| 68 | chargingProfile?: OCPP16ChargingProfile; |
| 69 | } |
| 70 | |
| 71 | export interface RemoteStopTransactionRequest extends JsonObject { |
| 72 | transactionId: number; |
| 73 | } |
| 74 | |
| 75 | export interface UnlockConnectorRequest extends JsonObject { |
| 76 | connectorId: number; |
| 77 | } |
| 78 | |
| 79 | export interface GetConfigurationRequest extends JsonObject { |
| 80 | key?: string | OCPP16StandardParametersKey[]; |
| 81 | } |
| 82 | |
| 83 | export enum ResetType { |
| 84 | HARD = 'Hard', |
| 85 | SOFT = 'Soft', |
| 86 | } |
| 87 | |
| 88 | export interface ResetRequest extends JsonObject { |
| 89 | type: ResetType; |
| 90 | } |
| 91 | |
| 92 | export interface SetChargingProfileRequest extends JsonObject { |
| 93 | connectorId: number; |
| 94 | csChargingProfiles: OCPP16ChargingProfile; |
| 95 | } |
| 96 | |
| 97 | export enum OCPP16AvailabilityType { |
| 98 | INOPERATIVE = 'Inoperative', |
| 99 | OPERATIVE = 'Operative', |
| 100 | } |
| 101 | |
| 102 | export interface ChangeAvailabilityRequest extends JsonObject { |
| 103 | connectorId: number; |
| 104 | type: OCPP16AvailabilityType; |
| 105 | } |
| 106 | |
| 107 | export interface ClearChargingProfileRequest extends JsonObject { |
| 108 | id?: number; |
| 109 | connectorId?: number; |
| 110 | chargingProfilePurpose?: ChargingProfilePurposeType; |
| 111 | stackLevel?: number; |
| 112 | } |
| 113 | |
| 114 | export interface GetDiagnosticsRequest extends JsonObject { |
| 115 | location: string; |
| 116 | retries?: number; |
| 117 | retryInterval?: number; |
| 118 | startTime?: Date; |
| 119 | stopTime?: Date; |
| 120 | } |
| 121 | |
| 122 | export interface DiagnosticsStatusNotificationRequest extends JsonObject { |
| 123 | status: OCPP16DiagnosticsStatus; |
| 124 | } |
| 125 | |
| 126 | export enum MessageTrigger { |
| 127 | BootNotification = 'BootNotification', |
| 128 | DiagnosticsStatusNotification = 'DiagnosticsStatusNotification', |
| 129 | FirmwareStatusNotification = 'FirmwareStatusNotification', |
| 130 | Heartbeat = 'Heartbeat', |
| 131 | MeterValues = 'MeterValues', |
| 132 | StatusNotification = 'StatusNotification', |
| 133 | } |
| 134 | |
| 135 | export interface OCPP16TriggerMessageRequest extends JsonObject { |
| 136 | requestedMessage: MessageTrigger; |
| 137 | connectorId?: number; |
| 138 | } |