Table of Contents

Class StaticCompanionDiscovery

Namespace
AppleTvControlLibrary.Discovery.Companion
Assembly
AppleTvControlLibrary.Discovery.dll

A discovery implementation that always returns a single, pre-configured device instead of performing an mDNS scan. Useful on hosts where multicast is unavailable or unreliable (see WP7 notes on Mono/embedded hosts), or when the address is already known.

public sealed class StaticCompanionDiscovery : ICompanionDiscovery
Inheritance
StaticCompanionDiscovery
Implements
Inherited Members

Remarks

Initializes a new instance of the StaticCompanionDiscovery class.

Constructors

StaticCompanionDiscovery(IPAddress, int, string, string?)

A discovery implementation that always returns a single, pre-configured device instead of performing an mDNS scan. Useful on hosts where multicast is unavailable or unreliable (see WP7 notes on Mono/embedded hosts), or when the address is already known.

public StaticCompanionDiscovery(IPAddress address, int port, string name = "", string? uniqueId = null)

Parameters

address IPAddress

The known address of the Companion Link device.

port int

The Companion Link port.

name string

An optional display name for the device.

uniqueId string

An optional stable unique identifier for the device.

Remarks

Initializes a new instance of the StaticCompanionDiscovery class.

Methods

ScanAsync(TimeSpan, CancellationToken)

Scans the network for Companion Link devices.

public Task<IReadOnlyList<CompanionDiscoveryResult>> ScanAsync(TimeSpan timeout, CancellationToken cancellationToken = default)

Parameters

timeout TimeSpan

How long to wait for responses.

cancellationToken CancellationToken

A token to cancel the scan.

Returns

Task<IReadOnlyList<CompanionDiscoveryResult>>

The discovered Companion Link devices.