X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Ftypes%2Focpp%2F1.6%2FRequests.ts;h=e7e662233aecb7ff6d4176111fd213aeaad30d37;hb=f29f53d00da5e3fb216e7b98b891bb2fc678d450;hp=71f8384f475d1e61b57880c3d061e5b5d62df135;hpb=d0641efac20e7bc7c114a3183574b6cad8667733;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 71f8384f..e7e66223 100644 --- a/src/types/ocpp/1.6/Requests.ts +++ b/src/types/ocpp/1.6/Requests.ts @@ -1,22 +1,14 @@ import { ChargePointErrorCode } from './ChargePointErrorCode'; import { ChargePointStatus } from './ChargePointStatus'; import { ChargingProfile } from './ChargingProfile'; -import { MessageType } from '../MessageType'; -import OCPPError from '../../../charging-station/OcppError'; - -export default interface Requests { - [id: string]: Request; -} - -export type Request = [(payload?, requestPayload?) => void, (error?: OCPPError) => void, Record]; - -export type IncomingRequest = [MessageType, string, IncomingRequestCommand, string, string]; +import { StandardParametersKey } from './Configuration'; export enum RequestCommand { BOOT_NOTIFICATION = 'BootNotification', HEARTBEAT = 'Heartbeat', STATUS_NOTIFICATION = 'StatusNotification', CHANGE_CONFIGURATION = 'ChangeConfiguration', + AUTHORIZE = 'Authorize', START_TRANSACTION = 'StartTransaction', STOP_TRANSACTION = 'StopTransaction', METERVALUES = 'MeterValues' @@ -25,6 +17,7 @@ export enum RequestCommand { export enum IncomingRequestCommand { RESET = 'Reset', CLEAR_CACHE = 'ClearCache', + CHANGE_AVAILABILITY = 'ChangeAvailability', UNLOCK_CONNECTOR = 'UnlockConnector', GET_CONFIGURATION = 'GetConfiguration', CHANGE_CONFIGURATION = 'ChangeConfiguration', @@ -59,7 +52,7 @@ export interface StatusNotificationRequest { } export interface ChangeConfigurationRequest { - key: string; + key: string | StandardParametersKey; value: string; } @@ -78,7 +71,7 @@ export interface UnlockConnectorRequest { } export interface GetConfigurationRequest { - key?: string[]; + key?: string | StandardParametersKey[]; } export enum ResetType { @@ -94,3 +87,13 @@ export interface SetChargingProfileRequest { connectorId: number; csChargingProfiles: ChargingProfile; } + +export enum AvailabilityType { + INOPERATIVE = 'Inoperative', + OPERATIVE = 'Operative' +} + +export interface ChangeAvailabilityRequest { + connectorId: number; + type: AvailabilityType; +}