import events from "node:events"; import type * as Models from "../models"; import type { BroadcastAddress } from "../zspec/enums"; import * as Zcl from "../zspec/zcl"; import type * as Zdo from "../zspec/zdo"; import type * as ZdoTypes from "../zspec/zdo/definition/tstypes"; import type * as AdapterEvents from "./events"; import type * as TsType from "./tstype"; export interface ZclWaitressPayload extends AdapterEvents.ZclPayload { header: NonNullable; } export interface ClusterWaitressMatcher { address: number | string | undefined; clusterId: number; endpoint?: number; commandId?: number; transactionSequenceNumber?: number; } interface AdapterEventMap { deviceJoined: [payload: AdapterEvents.DeviceJoinedPayload]; zclPayload: [payload: AdapterEvents.ZclPayload]; zdoResponse: [clusterId: Zdo.ClusterId, response: ZdoTypes.GenericZdoResponse]; disconnected: []; deviceLeave: [payload: AdapterEvents.DeviceLeavePayload]; } export declare abstract class Adapter extends events.EventEmitter { hasZdoMessageOverhead: boolean; manufacturerID: Zcl.ManufacturerCode; protected networkOptions: TsType.NetworkOptions; protected adapterOptions: TsType.AdapterOptions; protected serialPortOptions: TsType.SerialPortOptions; protected backupPath: string; protected constructor(networkOptions: TsType.NetworkOptions, serialPortOptions: TsType.SerialPortOptions, backupPath: string, adapterOptions: TsType.AdapterOptions); /** * Utility */ static create(networkOptions: TsType.NetworkOptions, serialPortOptions: TsType.SerialPortOptions, backupPath: string, adapterOptions: TsType.AdapterOptions): Promise; static clusterWaitressTimeoutFormatter(matcher: ClusterWaitressMatcher, timeout: number): string; static zclWaitressValidator(payload: ZclWaitressPayload, matcher: ClusterWaitressMatcher): boolean; abstract start(): Promise; abstract stop(): Promise; abstract getCoordinatorIEEE(): Promise; abstract getCoordinatorVersion(): Promise; abstract reset(type: "soft" | "hard"): Promise; abstract supportsBackup(): Promise; abstract backup(ieeeAddressesInDatabase: string[]): Promise; abstract getNetworkParameters(): Promise; abstract addInstallCode(ieeeAddress: string, key: Buffer, hashed: boolean): Promise; abstract waitFor(networkAddress: number, endpoint: number, frameType: Zcl.FrameType, direction: Zcl.Direction, transactionSequenceNumber: number | undefined, clusterId: number, commandId: number, timeout: number): { promise: Promise; cancel: () => void; }; /** * ZDO */ abstract sendZdo(ieeeAddress: string, networkAddress: number, clusterId: Zdo.ClusterId, payload: Buffer, disableResponse: true): Promise; abstract sendZdo(ieeeAddress: string, networkAddress: number, clusterId: K, payload: Buffer, disableResponse: false): Promise; abstract sendZdo(ieeeAddress: string, networkAddress: number, clusterId: K, payload: Buffer, disableResponse: boolean): Promise; abstract permitJoin(seconds: number, networkAddress?: number): Promise; /** * ZCL */ abstract sendZclFrameToEndpoint(ieeeAddr: string, networkAddress: number, endpoint: number, zclFrame: Zcl.Frame, timeout: number, disableResponse: boolean, disableRecovery: boolean, sourceEndpoint?: number, profileId?: number): Promise; abstract sendZclFrameToGroup(groupID: number, zclFrame: Zcl.Frame, sourceEndpoint?: number, profileId?: number): Promise; abstract sendZclFrameToAll(endpoint: number, zclFrame: Zcl.Frame, sourceEndpoint: number, destination: BroadcastAddress, profileId?: number): Promise; /** * InterPAN */ abstract setChannelInterPAN(channel: number): Promise; abstract sendZclFrameInterPANToIeeeAddr(zclFrame: Zcl.Frame, ieeeAddress: string): Promise; abstract sendZclFrameInterPANBroadcast(zclFrame: Zcl.Frame, timeout: number, disableResponse: false): Promise; abstract sendZclFrameInterPANBroadcast(zclFrame: Zcl.Frame, timeout: number, disableResponse: true): Promise; abstract sendZclFrameInterPANBroadcast(zclFrame: Zcl.Frame, timeout: number, disableResponse: boolean): Promise; abstract restoreChannelInterPAN(): Promise; } export default Adapter; //# sourceMappingURL=adapter.d.ts.map