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