X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Ftypes%2Focpp%2F1.6%2FRequests.ts;h=e7e662233aecb7ff6d4176111fd213aeaad30d37;hb=f29f53d00da5e3fb216e7b98b891bb2fc678d450;hp=e8368793e5835f56a141c9268317767f7bffffc8;hpb=8c476a1f1117b85fa29a435fc8733a482472139f;p=e-mobility-charging-stations-simulator.git diff --git a/src/types/ocpp/1.6/Requests.ts b/src/types/ocpp/1.6/Requests.ts index e8368793..e7e66223 100644 --- a/src/types/ocpp/1.6/Requests.ts +++ b/src/types/ocpp/1.6/Requests.ts @@ -1,14 +1,33 @@ import { ChargePointErrorCode } from './ChargePointErrorCode'; import { ChargePointStatus } from './ChargePointStatus'; import { ChargingProfile } from './ChargingProfile'; -import OCPPError from '../../../charging-station/OcppError'; +import { StandardParametersKey } from './Configuration'; -export default interface Requests { - [id: string]: [(payload?, requestPayload?) => void, (error?: OCPPError) => void, Record]; +export enum RequestCommand { + BOOT_NOTIFICATION = 'BootNotification', + HEARTBEAT = 'Heartbeat', + STATUS_NOTIFICATION = 'StatusNotification', + CHANGE_CONFIGURATION = 'ChangeConfiguration', + AUTHORIZE = 'Authorize', + START_TRANSACTION = 'StartTransaction', + STOP_TRANSACTION = 'StopTransaction', + METERVALUES = 'MeterValues' +} + +export enum IncomingRequestCommand { + RESET = 'Reset', + CLEAR_CACHE = 'ClearCache', + CHANGE_AVAILABILITY = 'ChangeAvailability', + UNLOCK_CONNECTOR = 'UnlockConnector', + GET_CONFIGURATION = 'GetConfiguration', + CHANGE_CONFIGURATION = 'ChangeConfiguration', + SET_CHARGING_PROFILE = 'SetChargingProfile', + REMOTE_START_TRANSACTION = 'RemoteStartTransaction', + REMOTE_STOP_TRANSACTION = 'RemoteStopTransaction' } // eslint-disable-next-line @typescript-eslint/no-empty-interface -export interface HeartbeatRequest {} +export interface HeartbeatRequest { } export interface BootNotificationRequest { chargeBoxSerialNumber?: string; @@ -33,7 +52,7 @@ export interface StatusNotificationRequest { } export interface ChangeConfigurationRequest { - key: string; + key: string | StandardParametersKey; value: string; } @@ -52,7 +71,7 @@ export interface UnlockConnectorRequest { } export interface GetConfigurationRequest { - key?: string[]; + key?: string | StandardParametersKey[]; } export enum ResetType { @@ -68,3 +87,13 @@ export interface SetChargingProfileRequest { connectorId: number; csChargingProfiles: ChargingProfile; } + +export enum AvailabilityType { + INOPERATIVE = 'Inoperative', + OPERATIVE = 'Operative' +} + +export interface ChangeAvailabilityRequest { + connectorId: number; + type: AvailabilityType; +}