import { TypedEventEmitter } from '../TypedEmitter'; import { LogLevel } from '../KnxLog'; import CEMIMessage from '../protocol/cEMI/CEMIMessage'; import KNXRoutingIndication from '../protocol/KNXRoutingIndication'; export type KNXIPTunnelServerOptions = { listenHost?: string; listenPort?: number; advertiseHost?: string; assignedIndividualAddress?: string; loglevel?: LogLevel; maxSessions?: number; }; export type KNXRawTelegramEvent = 'GroupValue_Write' | 'GroupValue_Response' | 'GroupValue_Read'; export type KNXRawTelegram = { event: KNXRawTelegramEvent; source: string; destination: string; apdu: { data: Buffer | null; bitlength: number; hex: string; }; cemi: { hex: string; }; }; type TunnelServerEvents = { error: (error: Error) => void; listening: (info: { host: string; port: number; }) => void; sessionUp: (info: { clientHost: string; clientPort: number; channelId: number; }) => void; sessionDown: (info: { clientHost: string; clientPort: number; channelId?: number; reason: string; }) => void; busFrameOut: (frame: Buffer, info: { channelId: number; }) => void; indication: (packet: KNXRoutingIndication, echoed: boolean) => void; rawTelegram: (telegram: KNXRawTelegram, info: { channelId: number; }) => void; }; export declare class KNXIPTunnelServer extends TypedEventEmitter { private readonly options; private readonly logger; private socket?; private sessions; private channelPool; constructor(options?: KNXIPTunnelServerOptions); get address(): { host: string; port: number; } | null; start(): Promise; stop(): Promise; injectBusFrame(frame: Buffer): void; injectBusFrameToChannel(channelId: number, frame: Buffer): void; injectIndication(packet: KNXRoutingIndication): void; injectIndicationToChannel(channelId: number, packet: KNXRoutingIndication): void; injectCemi(cemi: CEMIMessage): void; injectCemiToChannel(channelId: number, cemi: CEMIMessage): void; private refillChannelPool; private allocateChannelId; private freeChannelId; private ensureSession; private getSession; private findSessionByChannelId; private closeSession; private onMessage; private packetToFrame; private sendToClient; private sendToRInfo; private handleConnectRequest; private handleConnectionStateRequest; private handleDisconnectRequest; private handleTunnelingRequest; private extractRawTelegram; private buildRoutingIndicationFromTunneling; private sendBusFrameToClient; private sendCemiToClient; } export {};