PlainApp
API-referentie

Apparaten in de buurt ontdekken

Controleer app.capabilities voor functieondersteuning en app.access plus hostrechten voor autorisatie. Voorbeelden gebruiken synthetische waarden; vervang paden, ID’s, invoer en filters vóór aanroepen.

Device A
UDP → 224.0.0.251:5353
Device B

PTR query

UDP · DNS

IPv4-multicast, geen IP-broadcast: 224.0.0.251:5353. A zoekt elke 5 s; B kondigt zich ook bij het starten en elke 60 s aan. PTR-antwoorden bevatten SRV, TXT en A. De pop-ups tonen gedecodeerde synthetische DNS-records.

Beweeg over een veld of tik erop
1 / 3

Typedefinities

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
}

Bewerkingen

mutation

acquireMdnsDebugSession

Een mDNS-debugsessie verkrijgen met een UUID-token van de aanroeper. Vereist HTTP_SERVER; geef de sessie vrij bij het sluiten van de debugpagina.

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

releaseMdnsDebugSession

De mDNS-debugsessie vrijgeven met het bijbehorende token. Vereist HTTP_SERVER.

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

startDiscovery

Apparaatdetectie starten.

graphql
mutation startDiscovery {
  startDiscovery
}
mutation

stopDiscovery

Apparaatdetectie stoppen.

graphql
mutation stopDiscovery {
  stopDiscovery
}
query

isDiscovering

Of er momenteel een detectiescan loopt.

graphql
query isDiscovering {
  isDiscovering
}
query

mdnsState

De huidige mDNS-detectiestatus en geselecteerde service- of pakketdetails lezen.

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

nearbyDevices

Momenteel bekende apparaten in de buurt weergeven die voor detectie of koppeling beschikbaar zijn.

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

parsePairingQrCode

Een geldige koppelingscode decoderen naar verbindingsinformatie van een apparaat in de buurt.

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