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