Hi, <br><br>I'm currently working on a network based activity for the OLPC. Today we've met with Chris Blizzard who pointed me to this list.<br><br>I try to use the mdns through python. More generally I'd like to get more information and maybe some example (maybe some reference of code within sugar to look at ) on how to use the presence server.
<br><br>Here is what I've tried, but it doesn't work (it's a stripped down version of AvahiBookmark)<br><br>class AvahiTest:<br><br> def __init__(self, use_host_names):<br> self.bus = dbus.SystemBus()
<br> self.server = dbus.Interface(self.bus.get_object(avahi.DBUS_NAME, avahi.DBUS_PATH_SERVER), avahi.DBUS_INTERFACE_SERVER)<br> self.version_string = self.server.GetVersionString()<br> self.browse_service_type
("_presence_olpc._tcp")<br><br> def browse_service_type(self, stype):<br> domain="local"<br> browser = dbus.Interface(self.bus.get_object(avahi.DBUS_NAME, self.server.ServiceBrowserNew
(avahi.IF_UNSPEC, avahi.PROTO_UNSPEC, stype, domain, dbus.UInt32(0))), avahi.DBUS_INTERFACE_SERVICE_BROWSER)<br> browser.connect_to_signal('ItemNew', self.new_service)<br> browser.connect_to_signal('ItemRemove',
self.remove_service)<br><br> def new_service(self, interface, protocol, name, type, domain, flags):<br> print "new service!!!!"<br><br> def remove_service(self, interface, protocol, name, type, domain):
<br> print "service removed!!!"<br><br><br>Thks<br><br>Thibaut Lamadon<br><br><br>