Table of Contents

Class MrpServiceInfo

Namespace
AppleTvControlLibrary.Discovery.Mrp
Assembly
AppleTvControlLibrary.Discovery.dll

MRP (Media Remote Protocol) specific constants and parsing helpers for mDNS discovery.

public static class MrpServiceInfo
Inheritance
MrpServiceInfo
Inherited Members

Fields

SERVICE_TYPE

The MRP mDNS service type.

public const string SERVICE_TYPE = "_mediaremotetv._tcp.local"

Field Value

string

Methods

GetPairingRequirement(bool, IReadOnlyDictionary<string, string>)

Derives the pairing requirement for an MRP service from its enabled state and "allowpairing" TXT record.

public static MrpPairingRequirement GetPairingRequirement(bool isEnabled, IReadOnlyDictionary<string, string> properties)

Parameters

isEnabled bool

Whether MRP is considered enabled for this service, from IsEnabled(IReadOnlyDictionary<string, string>).

properties IReadOnlyDictionary<string, string>

The service's decoded TXT record properties.

Returns

MrpPairingRequirement

The derived pairing requirement.

GetUniqueId(IReadOnlyDictionary<string, string>)

Returns the stable unique identifier for an MRP service, from the "UniqueIdentifier" TXT record, or null if not present.

public static string? GetUniqueId(IReadOnlyDictionary<string, string> properties)

Parameters

properties IReadOnlyDictionary<string, string>

The service's decoded TXT record properties.

Returns

string

The unique identifier, or null.

IsEnabled(IReadOnlyDictionary<string, string>)

Returns whether MRP is considered enabled for the given service's properties. pyatv disables MRP once the "SystemBuildVersion" leading numeric build component is 19 or higher (tvOS 15+). A missing or unparseable "SystemBuildVersion" is treated as enabled, matching pyatv's behavior when its regex match fails.

public static bool IsEnabled(IReadOnlyDictionary<string, string> properties)

Parameters

properties IReadOnlyDictionary<string, string>

The service's decoded TXT record properties.

Returns

bool

true if MRP should be considered enabled for this service.

ToDiscoveryResult(Service)

Converts a parsed mDNS Service into an MrpDiscoveryResult.

public static MrpDiscoveryResult ToDiscoveryResult(Service service)

Parameters

service Service

The parsed mDNS service.

Returns

MrpDiscoveryResult

The MRP-specific discovery result.