summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2011-04-07 15:04:54 +0200
committerGravatar Martin Szulecki2011-04-07 15:04:54 +0200
commit3218ff200f946f517cfab9020001cd59319cd069 (patch)
treef1510db365f8d8ee2e4347ebeb62bea7beac6232
parentf740f4a270585c0375103f8c34416899a23c77bd (diff)
downloadtotem-plugin-airplay-3218ff200f946f517cfab9020001cd59319cd069.tar.gz
totem-plugin-airplay-3218ff200f946f517cfab9020001cd59319cd069.tar.bz2
Advertise deviceid, features and model in avahi service TXT data
-rw-r--r--AirPlayService.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/AirPlayService.py b/AirPlayService.py
index 9e6ef3b..3c9557c 100644
--- a/AirPlayService.py
+++ b/AirPlayService.py
@@ -25,6 +25,7 @@ import platform
import socket
import threading
import time
+import uuid
from datetime import datetime, date
from urlparse import urlparse
from ZeroconfService import ZeroconfService
@@ -215,11 +216,15 @@ class AirPlayService(asyncore.dispatcher):
self.bind((host, port))
self.listen(5)
self.remote_clients = []
+ macstr = "%012X" % uuid.getnode()
+ self.deviceid = ''.join("%s:" % macstr[i:i+2] for i in range(0, len(macstr), 2))[:-1]
+ self.features = 0x07 # 0x77 on iOS 4.3.1
+ self.model = "AppleTV2,1"
# create avahi service
if (name is None):
name = "Airplay Service on " + platform.node()
- self.zeroconf_service = ZeroconfService(name, port=port, stype="_airplay._tcp", text=["Name="+name])
+ self.zeroconf_service = ZeroconfService(name, port=port, stype="_airplay._tcp", text=["deviceid="+self.deviceid,"features="+hex(self.features),"model="+self.model])
# publish avahi service
self.zeroconf_service.publish()