Add apple test
This commit is contained in:
1 file changed
+40
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* Copyright © 2025 RTAkland
|
||||
* Author: RTAkland
|
||||
* Date: 9/30/25
|
||||
*/
|
||||
|
||||
|
||||
package test
|
||||
|
||||
import cn.rtast.nmdns.randomMacAddress
|
||||
import cn.rtast.nmdns.registerService
|
||||
import cn.rtast.nmdns.sleep1
|
||||
import kotlin.test.Test
|
||||
|
||||
class TestApple {
|
||||
|
||||
@Test
|
||||
fun `test on apple machine`() {
|
||||
val service = registerService(
|
||||
serviceType = "_airplay._tcp.local.",
|
||||
serviceName = "AP@RTAST",
|
||||
hostname = "rtakland.local.",
|
||||
ipAddress = "192.168.10.104",
|
||||
port = 7001,
|
||||
bindAddress = "192.168.10.104",
|
||||
mdnsPort = 5356,
|
||||
txtRecords = listOf(
|
||||
"deviceid=${randomMacAddress()}",
|
||||
"model=AppleTV3,2C",
|
||||
"features=0x5A7FFFF7,0x1E",
|
||||
"srcvers=220.68",
|
||||
"pk=f3769a660475d27b4f6040381d784645e13e21c53e6d2da6a8c3d757086fc336"
|
||||
)
|
||||
)
|
||||
while (true) {
|
||||
service.broadcast()
|
||||
sleep1(2)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user