<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, Sans-Serif;font-size:10px"><div id="yui_3_16_0_1_1416942699758_4477" dir="ltr"><span><font size="3">Hi Michael,</font></span></div><div id="yui_3_16_0_1_1416942699758_4477" dir="ltr"><span><font size="3"><br></font></span></div><div id="yui_3_16_0_1_1416942699758_4477" dir="ltr"><font size="3" id="yui_3_16_0_1_1416942699758_4617"><span id="yui_3_16_0_1_1416942699758_4622">I'm looking at your </span><span style="line-height: 19px; background-color: rgb(249, 250, 252);" class="" id="yui_3_16_0_1_1416942699758_4510">ZConfBrowserWidget and I see that it needs a service type. Technically I believe from what I've been reading the mDNS host announcements are different to an DNS-SD service, although they are both announced in a similar way.</span></font></div><div id="yui_3_16_0_1_1416942699758_4477" dir="ltr"><font size="3" id="yui_3_16_0_1_1416942699758_5418"><span style="line-height: 19px; background-color: rgb(249, 250, 252);" class="" id="yui_3_16_0_1_1416942699758_5417">Is there a "service type" that catches the mDNS hostname announcements?</span></font></div><div id="yui_3_16_0_1_1416942699758_4477" dir="ltr"><font size="3"><span style="line-height: 19px; background-color: rgb(249, 250, 252);" class=""><br></span></font></div><div id="yui_3_16_0_1_1416942699758_4477" dir="ltr"><font size="3"><span style="line-height: 19px; background-color: rgb(249, 250, 252);" class="">Regards,</span></font></div><div id="yui_3_16_0_1_1416942699758_4477" dir="ltr"><font size="3"><span style="line-height: 19px; background-color: rgb(249, 250, 252);" class=""><br></span></font></div><div id="yui_3_16_0_1_1416942699758_4477" dir="ltr"><font size="3" id="yui_3_16_0_1_1416942699758_5705"><span style="line-height: 19px; background-color: rgb(249, 250, 252);" class="" id="yui_3_16_0_1_1416942699758_5704">Jonathan</span></font></div> <div class="qtdSeparateBR"><br><br></div><div class="yahoo_quoted" style="display: block;"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, Sans-Serif; font-size: 10px;"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, Sans-Serif; font-size: 16px;"> <div dir="ltr"> <font size="2" face="Arial"> On Friday, 21 November 2014, 15:08, Jonathan Fitt <jonfitt@yahoo.com> wrote:<br> </font> </div>  <br><br> <div class="y_msg_container"><div id="yiv3978991876"><div><div>Thanks! I'll give that a go and let you know how it goes. </div><div><br clear="none"></div><div>Jonathan</div><div class="yiv3978991876yqt2754114434" id="yiv3978991876yqt70591"><div><br clear="none">On Nov 21, 2014, at 1:25 PM, Michael Jones <<a rel="nofollow" shape="rect" ymailto="mailto:avahi@jonesmz.com" target="_blank" href="mailto:avahi@jonesmz.com">avahi@jonesmz.com</a>> wrote:<br clear="none"><br clear="none"></div><blockquote type="cite"><div><div dir="ltr"><br clear="none"><div class="yiv3978991876gmail_extra"><div class="yiv3978991876gmail_quote"><blockquote class="yiv3978991876gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex;">
Hello,I am looking for a way for a Linux machine to tell when I return home. My idea is that my iPhone will always do an mDNS announcement when it joins my home wifi. So I'm looking for a way to watch for mDNS announcements and perform and action if the right one is seen. Obviously the avahi-daemon is watching these all the time and updating its cache, so I was thinking that there might be a good place to start. However the only command line way I can see to get to the avahi-daemon cache is to send a SIGUSR1 to get it to dump to /var/log/syslog. Then I can look at the timestamp to determine the last time it registered and compare with now. That seems quite ugly though, and I don't like the idea of continually dumping to syslog.<br clear="none">
So is there a way to make it more event driven with the avahi-daemon? I think from looking at the D-Bus API that might be the way to go?If it is the right approach, I would appreciate it if someone knew of a related chunk of source that I could use as a starting point.<br clear="none">
Thanks!Jonathan<br clear="none"><br clear="none"></blockquote><div><br clear="none"><div class="yiv3978991876gmail_extra">Write a small program that uses the Avahi API. A very high level wrapper for the Avahi API is: <a rel="nofollow" shape="rect" target="_blank" href="https://github.com/johanneshilden/qtzeroconf">https://github.com/johanneshilden/qtzeroconf</a><br clear="none"><br clear="none"></div><div class="yiv3978991876gmail_extra">Using that, you can detect your phone joining your home network in under 10 lines of code.<br clear="none">Create the service browser object<br clear="none">Connect
 that new object to a qt slot that'll respond to the new service joining
 your network, Tell the service browser object which services to listen 
for.<br clear="none"><br clear="none"></div><div class="yiv3978991876gmail_extra">From there, you can do 
whatever you want with the information. Perhaps you would want to send 
some kind of DBus signal to let other programs know. <br clear="none"><br clear="none"></div><div class="yiv3978991876gmail_extra">I'm
 afraid I haven't investigated the DBus API, so I'm not certain I can 
give you any advice in that direction, but I have written apps using the
 high level Qt API that I linked above, and I've never had any trouble 
with it.<br clear="none"><br clear="none"></div>--Michael Jones <br clear="none"></div></div><br clear="none"></div></div>
</div></blockquote></div><blockquote type="cite"><div><span>_______________________________________________</span><br clear="none"><span>avahi mailing list</span><br clear="none"><span><a rel="nofollow" shape="rect" ymailto="mailto:avahi@lists.freedesktop.org" target="_blank" href="mailto:avahi@lists.freedesktop.org">avahi@lists.freedesktop.org</a></span><br clear="none"><span><a rel="nofollow" shape="rect" target="_blank" href="http://lists.freedesktop.org/mailman/listinfo/avahi">http://lists.freedesktop.org/mailman/listinfo/avahi</a></span><br clear="none"></div></blockquote></div></div><br><br></div>  </div> </div>  </div> </div></body></html>