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, | |
edd13439 | 6 | type OCPP16BootNotificationResponse, |
e7aeea18 JB |
7 | OCPP16ChargingProfileStatus, |
8 | OCPP16ClearChargingProfileStatus, | |
9 | OCPP16ConfigurationStatus, | |
edd13439 | 10 | type OCPP16DataTransferResponse, |
91a7d3ea | 11 | OCPP16DataTransferStatus, |
edd13439 | 12 | type OCPP16HeartbeatResponse, |
e7aeea18 | 13 | OCPP16RegistrationStatus, |
edd13439 | 14 | type 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 | 50 | export const RegistrationStatus = { |
e7aeea18 | 51 | ...OCPP16RegistrationStatus, |
edd13439 JB |
52 | } as const; |
53 | export type RegistrationStatus = OCPP16RegistrationStatus; | |
9ccca265 JB |
54 | |
55 | export const AvailabilityStatus = { | |
e7aeea18 | 56 | ...OCPP16AvailabilityStatus, |
edd13439 JB |
57 | } as const; |
58 | export type AvailabilityStatus = OCPP16AvailabilityStatus; | |
9ccca265 JB |
59 | |
60 | export const ChargingProfileStatus = { | |
e7aeea18 | 61 | ...OCPP16ChargingProfileStatus, |
edd13439 JB |
62 | } as const; |
63 | export type ChargingProfileStatus = OCPP16ChargingProfileStatus; | |
9ccca265 JB |
64 | |
65 | export const ClearChargingProfileStatus = { | |
e7aeea18 | 66 | ...OCPP16ClearChargingProfileStatus, |
edd13439 JB |
67 | } as const; |
68 | export type ClearChargingProfileStatus = OCPP16ClearChargingProfileStatus; | |
9ccca265 JB |
69 | |
70 | export const ConfigurationStatus = { | |
e7aeea18 | 71 | ...OCPP16ConfigurationStatus, |
edd13439 JB |
72 | } as const; |
73 | export type ConfigurationStatus = OCPP16ConfigurationStatus; | |
9ccca265 JB |
74 | |
75 | export const UnlockStatus = { | |
e7aeea18 | 76 | ...OCPP16UnlockStatus, |
edd13439 JB |
77 | } as const; |
78 | export type UnlockStatus = OCPP16UnlockStatus; | |
802cfa13 JB |
79 | |
80 | export const TriggerMessageStatus = { | |
e7aeea18 | 81 | ...OCPP16TriggerMessageStatus, |
edd13439 JB |
82 | } as const; |
83 | export type TriggerMessageStatus = OCPP16TriggerMessageStatus; | |
91a7d3ea JB |
84 | |
85 | export const DataTransferStatus = { | |
86 | ...OCPP16DataTransferStatus, | |
edd13439 JB |
87 | } as const; |
88 | export type DataTransferStatus = OCPP16DataTransferStatus; |