1 import type ChargingStation from
'../../charging-station/ChargingStation';
2 import OCPPError from
'../../exception/OCPPError';
3 import { JsonType
} from
'../JsonType';
4 import { OCPP16DiagnosticsStatus
} from
'./1.6/DiagnosticsStatus';
5 import { OCPP16MeterValuesRequest
} from
'./1.6/MeterValues';
7 OCPP16AvailabilityType
,
8 OCPP16BootNotificationRequest
,
9 OCPP16HeartbeatRequest
,
10 OCPP16IncomingRequestCommand
,
12 OCPP16StatusNotificationRequest
,
13 } from
'./1.6/Requests';
14 import { MessageType
} from
'./MessageType';
16 export type OutgoingRequest
= [MessageType
.CALL_MESSAGE
, string, RequestCommand
, JsonType
];
18 export type IncomingRequest
= [MessageType
.CALL_MESSAGE
, string, IncomingRequestCommand
, JsonType
];
20 export type CachedRequest
= [
21 (payload
: JsonType
, requestPayload
: JsonType
) => void,
22 (error
: OCPPError
, requestStatistic
?: boolean) => void,
23 RequestCommand
| IncomingRequestCommand
,
27 export type IncomingRequestHandler
= (
28 chargingStation
: ChargingStation
,
29 commandPayload
: JsonType
30 ) => JsonType
| Promise
<JsonType
>;
32 export type ResponseType
= JsonType
| OCPPError
;
34 export interface RequestParams
{
35 skipBufferingOnError
?: boolean;
36 triggerMessage
?: boolean;
39 export type BootNotificationRequest
= OCPP16BootNotificationRequest
;
41 export type HeartbeatRequest
= OCPP16HeartbeatRequest
;
43 export type StatusNotificationRequest
= OCPP16StatusNotificationRequest
;
45 export type MeterValuesRequest
= OCPP16MeterValuesRequest
;
47 export type AvailabilityType
= OCPP16AvailabilityType
;
49 export const AvailabilityType
= {
50 ...OCPP16AvailabilityType
,
53 export type RequestCommand
= OCPP16RequestCommand
;
55 export const RequestCommand
= {
56 ...OCPP16RequestCommand
,
59 export type IncomingRequestCommand
= OCPP16IncomingRequestCommand
;
61 export const IncomingRequestCommand
= {
62 ...OCPP16IncomingRequestCommand
,
65 export type DiagnosticsStatus
= OCPP16DiagnosticsStatus
;
67 export const DiagnosticsStatus
= {
68 ...OCPP16DiagnosticsStatus
,