X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Ftypes%2Focpp%2F1.6%2FRequests.ts;h=bbcf5145e321cd560b92b92e68241de9fdfbeedb;hb=d9f60ba1bd2b6d44bc99bf02d76d8da16a0566e6;hp=78123f87ece78fa591438fb30ad49de29ed4f26a;hpb=63b48f776a09ac5a5ffb5b161c108e3ca625a3cb;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 78123f87..bbcf5145 100644 --- a/src/types/ocpp/1.6/Requests.ts +++ b/src/types/ocpp/1.6/Requests.ts @@ -1,5 +1,91 @@ +import { ChargePointErrorCode } from './ChargePointErrorCode'; +import { ChargePointStatus } from './ChargePointStatus'; +import { ChargingProfile } from './ChargingProfile'; import OCPPError from '../../../charging-station/OcppError'; export default interface Requests { - [id: string]: [(payload?, requestPayload?) => void, (error?: OCPPError) => void, object]; + [id: string]: [(payload?, requestPayload?) => void, (error?: OCPPError) => void, Record]; +} + +export enum RequestCommand { + BOOT_NOTIFICATION = 'BootNotification', + HEARTBEAT = 'Heartbeat', + STATUS_NOTIFICATION = 'StatusNotification', + CHANGE_CONFIGURATION = 'ChangeConfiguration', + START_TRANSACTION = 'StartTransaction', + STOP_TRANSACTION = 'StopTransaction', + METERVALUES = 'MeterValues' +} + +export enum IncomingRequestCommand { + RESET = 'Reset', + CLEAR_CACHE = 'ClearCache', + 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 BootNotificationRequest { + chargeBoxSerialNumber?: string; + chargePointModel: string; + chargePointSerialNumber?: string; + chargePointVendor: string; + firmwareVersion?: string; + iccid?: string; + imsi?: string; + meterSerialNumber?: string; + meterType?: string; +} + +export interface StatusNotificationRequest { + connectorId: number; + errorCode: ChargePointErrorCode; + info?: string; + status: ChargePointStatus; + timestamp?: string; + vendorId?: string; + vendorErrorCode?: string; +} + +export interface ChangeConfigurationRequest { + key: string; + value: string; +} + +export interface RemoteStartTransactionRequest { + connectorId: number; + idTag: string; + chargingProfile?: ChargingProfile; +} + +export interface RemoteStopTransactionRequest { + transactionId: number; +} + +export interface UnlockConnectorRequest { + connectorId: number; +} + +export interface GetConfigurationRequest { + key?: string[]; +} + +export enum ResetType { + HARD = 'Hard', + SOFT = 'Soft' +} + +export interface ResetRequest { + type: ResetType; +} + +export interface SetChargingProfileRequest { + connectorId: number; + csChargingProfiles: ChargingProfile; }