| 1 | import type { OCPP16MeterValue } from './MeterValues'; |
| 2 | import type { JsonObject } from '../../JsonType'; |
| 3 | |
| 4 | export enum OCPP16StopTransactionReason { |
| 5 | NONE = '', |
| 6 | EMERGENCY_STOP = 'EmergencyStop', |
| 7 | EV_DISCONNECTED = 'EVDisconnected', |
| 8 | HARD_RESET = 'HardReset', |
| 9 | LOCAL = 'Local', |
| 10 | OTHER = 'Other', |
| 11 | POWER_LOSS = 'PowerLoss', |
| 12 | REBOOT = 'Reboot', |
| 13 | REMOTE = 'Remote', |
| 14 | SOFT_RESET = 'SoftReset', |
| 15 | UNLOCK_COMMAND = 'UnlockCommand', |
| 16 | DE_AUTHORIZED = 'DeAuthorized', |
| 17 | } |
| 18 | |
| 19 | export enum OCPP16AuthorizationStatus { |
| 20 | ACCEPTED = 'Accepted', |
| 21 | BLOCKED = 'Blocked', |
| 22 | EXPIRED = 'Expired', |
| 23 | INVALID = 'Invalid', |
| 24 | CONCURRENT_TX = 'ConcurrentTx', |
| 25 | } |
| 26 | |
| 27 | interface IdTagInfo extends JsonObject { |
| 28 | status: OCPP16AuthorizationStatus; |
| 29 | parentIdTag?: string; |
| 30 | expiryDate?: Date; |
| 31 | } |
| 32 | |
| 33 | export interface OCPP16AuthorizeRequest extends JsonObject { |
| 34 | idTag: string; |
| 35 | } |
| 36 | |
| 37 | export interface OCPP16AuthorizeResponse extends JsonObject { |
| 38 | idTagInfo: IdTagInfo; |
| 39 | } |
| 40 | |
| 41 | export interface OCPP16StartTransactionRequest extends JsonObject { |
| 42 | connectorId: number; |
| 43 | idTag: string; |
| 44 | meterStart: number; |
| 45 | timestamp: Date; |
| 46 | reservationId?: number; |
| 47 | } |
| 48 | |
| 49 | export interface OCPP16StartTransactionResponse extends JsonObject { |
| 50 | idTagInfo: IdTagInfo; |
| 51 | transactionId: number; |
| 52 | } |
| 53 | |
| 54 | export interface OCPP16StopTransactionRequest extends JsonObject { |
| 55 | idTag?: string; |
| 56 | meterStop: number; |
| 57 | timestamp: Date; |
| 58 | transactionId: number; |
| 59 | reason?: OCPP16StopTransactionReason; |
| 60 | transactionData?: OCPP16MeterValue[]; |
| 61 | } |
| 62 | |
| 63 | export interface OCPP16StopTransactionResponse extends JsonObject { |
| 64 | idTagInfo?: IdTagInfo; |
| 65 | } |