X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Ftypes%2Focpp%2FResponses.ts;h=c57510ae7eaf04ebb71d9c407e9a9007b574a9c3;hb=ebbfbf1c01e010d051956867484b74a94237f546;hp=50f1d2b134f9b71867ac7eb02b92ae4b11fac827;hpb=e7aeea18e189dd087c8f951cf77a253e2818ae90;p=e-mobility-charging-stations-simulator.git diff --git a/src/types/ocpp/Responses.ts b/src/types/ocpp/Responses.ts index 50f1d2b1..c57510ae 100644 --- a/src/types/ocpp/Responses.ts +++ b/src/types/ocpp/Responses.ts @@ -1,31 +1,47 @@ +import type ChargingStation from '../../charging-station/ChargingStation'; +import type { JsonType } from '../JsonType'; +import type { OCPP16MeterValuesResponse } from './1.6/MeterValues'; import { OCPP16AvailabilityStatus, OCPP16BootNotificationResponse, OCPP16ChargingProfileStatus, OCPP16ClearChargingProfileStatus, OCPP16ConfigurationStatus, + OCPP16HeartbeatResponse, OCPP16RegistrationStatus, + OCPP16StatusNotificationResponse, OCPP16TriggerMessageStatus, OCPP16UnlockStatus, } from './1.6/Responses'; +import type { ErrorType } from './ErrorType'; +import type { MessageType } from './MessageType'; -import { JsonType } from '../JsonType'; +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; export type BootNotificationResponse = OCPP16BootNotificationResponse; +export type HeartbeatResponse = OCPP16HeartbeatResponse; + +export type StatusNotificationResponse = OCPP16StatusNotificationResponse; + +export type MeterValuesResponse = OCPP16MeterValuesResponse; + export enum DefaultStatus { ACCEPTED = 'Accepted', REJECTED = 'Rejected', } -export interface DefaultResponse { +export type DefaultResponse = { status: DefaultStatus; -} +}; export type RegistrationStatus = OCPP16RegistrationStatus;