import { type ChannelConfiguration, type MPDU, type MaybeNotKnown, type ProtocolDataRate, type RFRegion, type RSSI } from "@zwave-js/core"; import type { ChannelInfo, TransmitCallbackStatus, TransmitReplacement, TransmitResponseStatus } from "@zwave-js/serial"; import type { BytesView, EventListener, TypedEventTarget } from "@zwave-js/shared"; export interface RegionConfig { region: RFRegion; channelConfig: ChannelConfiguration; channels: ChannelInfo[]; } export type TransmitResult = TransmitResponseStatus | TransmitCallbackStatus; /** The TX power range the radio supports, in dBm */ export interface TxPowerRange { min: number; max: number; } /** Look up the data rate of a channel, throwing if the current region does not have it */ export declare function getProtocolDataRateOrThrow(channels: MaybeNotKnown, channel: number): ProtocolDataRate; export interface TransmitOptions { channel: number; /** * The transmit power in dBm, in steps of 0.1 dBm. * If omitted, the firmware keeps its current setting. */ txPower?: number; /** * Whether to perform clear channel assessment before transmitting. * Required, so that omitting it cannot silently skip CCA */ withCCA: boolean; /** * Byte positions the firmware patches with fresh measurements right before * the transmit. Only the listed bytes are replaced. */ replacements?: TransmitReplacement[]; } export interface TransmitBeamOptions { /** * The transmit power in dBm, in steps of 0.1 dBm. * If omitted, the firmware keeps its current setting. */ txPower?: number; numFragments: number; fragmentDurationMs: number; fragmentPeriodMs: number; /** The channels the beam fragments are transmitted on, in order */ channels: number[]; data: BytesView; } export interface MpduRxInfo { channel: number; rssi: RSSI; protocolDataRate: ProtocolDataRate; } export interface PHYLayerEventCallbacks { "mpdu received": (mpdu: MPDU, info: MpduRxInfo) => void; [others: string]: EventListener; } export type PHYLayerEvents = Extract; /** Defines functionality that must be provided by the PHY layer */ export interface PHYLayer extends TypedEventTarget { /** Query the currently configured region settings and capabilities */ queryRegion(): Promise; /** Return cached information about the current region settings */ get regionConfig(): MaybeNotKnown; /** Return the TX power range the radio supports, if the firmware reports it */ get txPowerRange(): MaybeNotKnown; /** Configure the region and channel config, returning the capabilities of the newly configured region */ setRegion(region: RFRegion, channelConfig: ChannelConfiguration): Promise; /** Transmit an MPDU on the given channel and return the result of this transmit attempt */ transmit(mpdu: BytesView, options: TransmitOptions): Promise; /** * Transmit a beam and return the result of this transmit attempt. * The firmware executes the beam autonomously and only reports back when it is done or was aborted. */ transmitBeam(options: TransmitBeamOptions): Promise; /** Stop an ongoing beam transmission */ abortBeam(): Promise; /** Whether the firmware can stop an ongoing beam transmission */ get supportsAbortBeam(): boolean; /** Measure the noise floor on the given channel, in dBm */ measureNoiseFloor(channel: number): Promise; /** Whether the firmware can measure the noise floor on demand */ get supportsMeasureNoiseFloor(): boolean; /** Whether the firmware can patch measurements into a frame right before transmitting */ get supportsTransmitReplacements(): boolean; /** Destroys this PHY layer instance */ destroy(): Promise; } export type PHYLayerFactory = () => Promise; //# sourceMappingURL=PHYLayer.d.ts.map