API-Referenz

Geräte in der Nähe

Funktionsunterstützung über app.capabilities prüfen, Autorisierung über app.access und Host-Berechtigungen. Die Beispiele verwenden synthetische Werte; vor dem Aufruf Pfade, IDs, Eingaben und Filter ersetzen.

Device A
UDP → 224.0.0.251:5353
Device B

PTR query

UDP · DNS

IPv4-Multicast, kein IP-Broadcast: 224.0.0.251:5353. A sucht alle 5 Sekunden; B kündigt sich zusätzlich beim Start und alle 60 Sekunden an. PTR-Antworten enthalten SRV, TXT und A. Die Popups zeigen dekodierte synthetische DNS-Datensätze.

Feld mit der Maus oder durch Antippen öffnen
1 / 3

Typdefinitionen

graphql
type Mutation {
  acquireMdnsDebugSession(token: String!): Boolean!
  releaseMdnsDebugSession(token: String!): Boolean!
  startDiscovery: Boolean!
  stopDiscovery: Boolean!
}

type Query {
  isDiscovering: Boolean!
  mdnsState: MdnsState!
  nearbyDevices: [NearbyDevice!]!
  parsePairingQrCode(code: String!): NearbyDevice
}

enum DeviceType {
	COMPUTER
	PHONE
	TABLET
	TV
	NAS
	OTHER
}

enum DiscoveryMethod {
	LAN
	BLE
	QR
}

scalar Instant

scalar Long

type MdnsActivity {
	time: Instant!
	event: String!
	detail: String!
}

type MdnsPacket {
	time: Instant!
	direction: MdnsPacketDirection!
	srcIp: String!
	srcPort: Int!
	dstIp: String!
	dstPort: Int!
	size: Long!
	summary: String!
	detail: String!
}

enum MdnsPacketDirection {
	IN
	OUT
}

type MdnsService {
	serviceType: String!
	instanceName: String!
	instanceFqdn: String!
	hostname: String!
	port: Int!
	txtRecords: [String!]!
	ips: [String!]!
	ip6s: [String!]!
	complete: Boolean!
}

type MdnsState {
	runtimeId: String!
	packetsIn: [MdnsPacket!]!
	packetsOut: [MdnsPacket!]!
	revision: Long!
	running: Boolean!
	scanning: Boolean!
	services: [MdnsService!]!
	activity: [MdnsActivity!]!
}

type NearbyDevice {
	id: ID!
	name: String!
	ips: [String!]!
	port: Int!
	remoteAccess: Boolean
	signaturePublicKey: String!
	deviceType: DeviceType!
	version: String!
	platform: String!
	discoveryMethods: [DiscoveryMethod!]!
	bestIp: String!
	status: PeerStatus!
	lastSeen: Instant!
}

enum PeerStatus {
	PAIRED
	UNPAIRED
	CHANNEL
}

Operationen

mutation

acquireMdnsDebugSession

Eine mDNS-Debugsitzung mit einem UUID-Token des Aufrufers anfordern. Erfordert HTTP_SERVER; beim Schließen der Debugseite freigeben.

graphql
mutation acquireMdnsDebugSession($token: String!) {
  acquireMdnsDebugSession(token: $token)
}
mutation

releaseMdnsDebugSession

Die mDNS-Debugsitzung mit dem zugehörigen Token freigeben. Erfordert HTTP_SERVER.

graphql
mutation releaseMdnsDebugSession($token: String!) {
  releaseMdnsDebugSession(token: $token)
}
mutation

startDiscovery

Startet die Geräteerkennung.

graphql
mutation startDiscovery {
  startDiscovery
}
mutation

stopDiscovery

Stoppt die Geräteerkennung.

graphql
mutation stopDiscovery {
  stopDiscovery
}
query

isDiscovering

Gibt an, ob gerade eine Geräteerkennung läuft.

graphql
query isDiscovering {
  isDiscovering
}
query

mdnsState

Liest den aktuellen mDNS-Erkennungsstatus und ausgewählte Dienst- oder Paketdetails.

graphql
query mdnsState {
  mdnsState { runtimeId revision running scanning }
}
query

nearbyDevices

Listet aktuell bekannte Geräte in der Nähe für Erkennung oder Kopplung auf.

graphql
query nearbyDevices {
  nearbyDevices { id name ips port remoteAccess signaturePublicKey deviceType version }
}
query

parsePairingQrCode

Dekodiert einen gültigen Kopplungscode in Verbindungsinformationen für ein Gerät in der Nähe.

graphql
query parsePairingQrCode($code: String!) {
  parsePairingQrCode(code: $code) { id name ips port remoteAccess signaturePublicKey deviceType version }
}