X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Ftypes%2Focpp%2FResponses.ts;h=c57510ae7eaf04ebb71d9c407e9a9007b574a9c3;hb=c56450e3b2ecbe265caadd9f87a9ef0bf231a70f;hp=d7e6db554f68456e79aac01709f4366b6bbaeb64;hpb=f22266fd29f7f11ba883d7f799ef607be05d4232;p=e-mobility-charging-stations-simulator.git diff --git a/src/types/ocpp/Responses.ts b/src/types/ocpp/Responses.ts index d7e6db55..c57510ae 100644 --- a/src/types/ocpp/Responses.ts +++ b/src/types/ocpp/Responses.ts @@ -1,3 +1,6 @@ +import type ChargingStation from '../../charging-station/ChargingStation'; +import type { JsonType } from '../JsonType'; +import type { OCPP16MeterValuesResponse } from './1.6/MeterValues'; import { OCPP16AvailabilityStatus, OCPP16BootNotificationResponse, @@ -10,12 +13,16 @@ import { OCPP16TriggerMessageStatus, OCPP16UnlockStatus, } from './1.6/Responses'; +import type { ErrorType } from './ErrorType'; +import type { MessageType } from './MessageType'; -import { JsonType } from '../JsonType'; -import { OCPP16MeterValuesResponse } from './1.6/MeterValues'; +export type Response = [MessageType.CALL_RESULT_MESSAGE, string, JsonType]; + +export type ErrorResponse = [MessageType.CALL_ERROR_MESSAGE, string, ErrorType, string, JsonType]; export type ResponseHandler = ( - payload: JsonType | string, + chargingStation: ChargingStation, + payload: JsonType, requestPayload?: JsonType ) => void | Promise; @@ -32,9 +39,9 @@ export enum DefaultStatus { REJECTED = 'Rejected', } -export interface DefaultResponse { +export type DefaultResponse = { status: DefaultStatus; -} +}; export type RegistrationStatus = OCPP16RegistrationStatus;