Add initial python bindings to the library
[deb_shairplay.git] / src / test / test.py
diff --git a/src/test/test.py b/src/test/test.py
new file mode 100644 (file)
index 0000000..d8ffd13
--- /dev/null
@@ -0,0 +1,20 @@
+import time
+from struct import *
+from Shairplay import *
+
+hwaddr = pack('BBBBBB', 0x01, 0x23, 0x45, 0x67, 0x89, 0xAB)
+
+shairplay = LoadShairplay(".")
+
+raop = RaopService(shairplay, RaopCallbacks())
+port = raop.start(5000, hwaddr)
+
+dnssd = DnssdService(shairplay)
+dnssd.register_raop("RAOP test", port)
+
+time.sleep(50)
+
+dnssd.unregister_raop()
+raop.stop()
+del raop
+