Commit | Line | Data |
---|---|---|
e7aeea18 JB |
1 | import { |
2 | OCPP16AvailabilityStatus, | |
3 | OCPP16BootNotificationResponse, | |
4 | OCPP16ChargingProfileStatus, | |
5 | OCPP16ClearChargingProfileStatus, | |
6 | OCPP16ConfigurationStatus, | |
f22266fd | 7 | OCPP16HeartbeatResponse, |
e7aeea18 | 8 | OCPP16RegistrationStatus, |
f22266fd | 9 | OCPP16StatusNotificationResponse, |
e7aeea18 JB |
10 | OCPP16TriggerMessageStatus, |
11 | OCPP16UnlockStatus, | |
12 | } from './1.6/Responses'; | |
c0560973 | 13 | |
f3a490e6 | 14 | import type ChargingStation from '../../charging-station/ChargingStation'; |
b3ec7bc1 | 15 | import { ErrorType } from './ErrorType'; |
5cc4b63b | 16 | import { JsonType } from '../JsonType'; |
b3ec7bc1 | 17 | import { MessageType } from './MessageType'; |
f22266fd | 18 | import { OCPP16MeterValuesResponse } from './1.6/MeterValues'; |
d1888640 | 19 | |
5cc4b63b | 20 | export type Response = [MessageType.CALL_RESULT_MESSAGE, string, JsonType]; |
b3ec7bc1 | 21 | |
5cc4b63b | 22 | export type ErrorResponse = [MessageType.CALL_ERROR_MESSAGE, string, ErrorType, string, JsonType]; |
b3ec7bc1 | 23 | |
e7aeea18 | 24 | export type ResponseHandler = ( |
08f130a0 | 25 | chargingStation: ChargingStation, |
5cc4b63b JB |
26 | payload: JsonType, |
27 | requestPayload?: JsonType | |
e7aeea18 | 28 | ) => void | Promise<void>; |
58144adb | 29 | |
c0560973 JB |
30 | export type BootNotificationResponse = OCPP16BootNotificationResponse; |
31 | ||
f22266fd JB |
32 | export type HeartbeatResponse = OCPP16HeartbeatResponse; |
33 | ||
34 | export type StatusNotificationResponse = OCPP16StatusNotificationResponse; | |
35 | ||
36 | export type MeterValuesResponse = OCPP16MeterValuesResponse; | |
37 | ||
9ccca265 JB |
38 | export enum DefaultStatus { |
39 | ACCEPTED = 'Accepted', | |
e7aeea18 | 40 | REJECTED = 'Rejected', |
9ccca265 JB |
41 | } |
42 | ||
43 | export interface DefaultResponse { | |
44 | status: DefaultStatus; | |
45 | } | |
46 | ||
c0560973 JB |
47 | export type RegistrationStatus = OCPP16RegistrationStatus; |
48 | ||
49 | export const RegistrationStatus = { | |
e7aeea18 | 50 | ...OCPP16RegistrationStatus, |
c0560973 | 51 | }; |
9ccca265 JB |
52 | |
53 | export type AvailabilityStatus = OCPP16AvailabilityStatus; | |
54 | ||
55 | export const AvailabilityStatus = { | |
e7aeea18 | 56 | ...OCPP16AvailabilityStatus, |
9ccca265 JB |
57 | }; |
58 | ||
59 | export type ChargingProfileStatus = OCPP16ChargingProfileStatus; | |
60 | ||
61 | export const ChargingProfileStatus = { | |
e7aeea18 | 62 | ...OCPP16ChargingProfileStatus, |
9ccca265 JB |
63 | }; |
64 | ||
65 | export type ClearChargingProfileStatus = OCPP16ClearChargingProfileStatus; | |
66 | ||
67 | export const ClearChargingProfileStatus = { | |
e7aeea18 | 68 | ...OCPP16ClearChargingProfileStatus, |
9ccca265 JB |
69 | }; |
70 | ||
71 | export type ConfigurationStatus = OCPP16ConfigurationStatus; | |
72 | ||
73 | export const ConfigurationStatus = { | |
e7aeea18 | 74 | ...OCPP16ConfigurationStatus, |
9ccca265 JB |
75 | }; |
76 | ||
77 | export type UnlockStatus = OCPP16UnlockStatus; | |
78 | ||
79 | export const UnlockStatus = { | |
e7aeea18 | 80 | ...OCPP16UnlockStatus, |
9ccca265 | 81 | }; |
802cfa13 JB |
82 | |
83 | export type TriggerMessageStatus = OCPP16TriggerMessageStatus; | |
84 | ||
85 | export const TriggerMessageStatus = { | |
e7aeea18 | 86 | ...OCPP16TriggerMessageStatus, |
802cfa13 | 87 | }; |