API Referansı

Yakındaki cihazları keşfetme

Özellik desteği için app.capabilities, yetkilendirme için app.access ve ana makine izinlerini kontrol edin. Çağrıdan önce örnek değerleri değiştirin.

Device A
UDP → 224.0.0.251:5353
Device B

PTR query

UDP · DNS

IP yayını değil IPv4 çok noktaya yayını: 224.0.0.251:5353. A her 5 sn tarar; B başlangıçta ve her 60 sn duyuru yapar. PTR yanıtları SRV, TXT ve A içerir. Çözülmüş sentetik DNS kayıtları açılır pencerelerde gösterilir.

Alanın üzerine gelin veya dokunun
1 / 3

Tip Tanımları

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
}

İşlemler

mutation

acquireMdnsDebugSession

Çağırana ait UUID belirteciyle mDNS hata ayıklama oturumu edinin. HTTP_SERVER gerekir; sayfa kapanırken oturumu serbest bırakın.

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

releaseMdnsDebugSession

Eşleşen belirteçle mDNS hata ayıklama oturumunu serbest bırakın. HTTP_SERVER gerekir.

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

startDiscovery

Cihaz keşfini başlatır.

graphql
mutation startDiscovery {
  startDiscovery
}
mutation

stopDiscovery

Cihaz keşfini durdurur.

graphql
mutation stopDiscovery {
  stopDiscovery
}
query

isDiscovering

Keşif taramasının şu an çalışıp çalışmadığını belirtir.

graphql
query isDiscovering {
  isDiscovering
}
query

mdnsState

Mevcut mDNS keşif durumunu ve seçili hizmet veya paket ayrıntılarını okur.

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

nearbyDevices

Keşif veya eşleştirme için mevcut, şu an bilinen yakındaki cihazları listeler.

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

parsePairingQrCode

Geçerli eşleştirme kodunu yakındaki cihaz bağlantı bilgilerine çözer.

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