UI protocol: add OCPP heartbeat command support
[e-mobility-charging-stations-simulator.git] / src / types / WorkerBroadcastChannel.ts
CommitLineData
6c1761d4 1import type { RequestPayload, ResponsePayload } from './UIProtocol';
32de5a57 2
4e3ff94d
JB
3export type BroadcastChannelRequest = [
4 string,
5 BroadcastChannelProcedureName,
6 BroadcastChannelRequestPayload
7];
8export type BroadcastChannelResponse = [string, BroadcastChannelResponsePayload];
89b7a234
JB
9
10export enum BroadcastChannelProcedureName {
11 START_CHARGING_STATION = 'startChargingStation',
12 STOP_CHARGING_STATION = 'stopChargingStation',
db2336d9
JB
13 OPEN_CONNECTION = 'openConnection',
14 CLOSE_CONNECTION = 'closeConnection',
4f69be04
JB
15 START_TRANSACTION = 'startTransaction',
16 STOP_TRANSACTION = 'stopTransaction',
17 START_AUTOMATIC_TRANSACTION_GENERATOR = 'startAutomaticTransactionGenerator',
18 STOP_AUTOMATIC_TRANSACTION_GENERATOR = 'stopAutomaticTransactionGenerator',
a9ed42b2 19 STATUS_NOTIFICATION = 'statusNotification',
10db00b2 20 HEARTBEAT = 'heartbeat',
89b7a234
JB
21}
22
39257250 23export interface BroadcastChannelRequestPayload extends RequestPayload {
32de5a57
LM
24 connectorId?: number;
25 transactionId?: number;
26 idTag?: string;
27}
89b7a234 28
a9ed42b2
JB
29export interface BroadcastChannelResponsePayload
30 extends Omit<ResponsePayload, 'hashIdsSucceeded' | 'hashIdsFailed' | 'responsesFailed'> {
10d244c0
JB
31 hashId: string;
32}
6c8f5d90
JB
33
34export type MessageEvent = { data: BroadcastChannelRequest | BroadcastChannelResponse };