Class CompanionServiceInfo
- Namespace
- AppleTvControlLibrary.Discovery.Companion
- Assembly
- AppleTvControlLibrary.Discovery.dll
Companion Link specific constants and parsing helpers for mDNS discovery.
public static class CompanionServiceInfo
- Inheritance
-
CompanionServiceInfo
- Inherited Members
Fields
SERVICE_TYPE
The Companion Link mDNS service type.
public const string SERVICE_TYPE = "_companion-link._tcp.local"
Field Value
Methods
GetPairingRequirement(IReadOnlyDictionary<string, string>)
Derives the pairing requirement for a Companion service from its "rpfl" TXT record.
public static CompanionPairingRequirement GetPairingRequirement(IReadOnlyDictionary<string, string> properties)
Parameters
propertiesIReadOnlyDictionary<string, string>The service's decoded TXT record properties.
Returns
- CompanionPairingRequirement
The derived pairing requirement.
GetUniqueId(IReadOnlyDictionary<string, string>)
Returns the stable unique identifier for a Companion service, from the "rpmrtid" TXT record, or null if not present.
public static string? GetUniqueId(IReadOnlyDictionary<string, string> properties)
Parameters
propertiesIReadOnlyDictionary<string, string>The service's decoded TXT record properties.
Returns
Remarks
This identifies the Apple TV, not the client - it is unrelated to the client identity ("_i") that Companion pairing/session code generates and persists locally. Also note pyatv's own comment (helpers.py:74) only claims this is static on tvOS 16 "(maybe earlier)"; there is no source statement covering tvOS 18+, so this is an observation carried from pyatv, not a documented guarantee.
ToDiscoveryResult(Service)
Converts a parsed mDNS Service into a CompanionDiscoveryResult.
public static CompanionDiscoveryResult ToDiscoveryResult(Service service)
Parameters
serviceServiceThe parsed mDNS service.
Returns
- CompanionDiscoveryResult
The Companion-specific discovery result.