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