From 3218ff200f946f517cfab9020001cd59319cd069 Mon Sep 17 00:00:00 2001 From: Martin Szulecki Date: Thu, 7 Apr 2011 15:04:54 +0200 Subject: Advertise deviceid, features and model in avahi service TXT data --- AirPlayService.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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() -- cgit v1.1-32-gdbae