From 8a9936a4a5a59ccd971e6a6c76eb6cc9d9056e21 Mon Sep 17 00:00:00 2001 From: Jonathan Bagg Date: Mon, 9 Oct 2017 21:25:58 -0400 Subject: [PATCH] Add publishExists() and browserExists() api calls. --- avahiclient.cpp | 16 ++++++++++++++++ avahicore.cpp | 16 ++++++++++++++++ bonjour.cpp | 16 ++++++++++++++++ 3 files changed, 48 insertions(+) diff --git a/avahiclient.cpp b/avahiclient.cpp index 99b38a7..a7672e2 100644 --- a/avahiclient.cpp +++ b/avahiclient.cpp @@ -271,6 +271,14 @@ void QZeroConf::stopServicePublish(void) } } +bool QZeroConf::publishExists(void) +{ + if (pri->group) + return true; + else + return false; +} + // http://www.zeroconf.org/rendezvous/txtrecords.html void QZeroConf::addServiceTxtRecord(QString nameOnly) @@ -314,3 +322,11 @@ void QZeroConf::stopBrowser(void) { pri->broswerCleanUp(); } + +bool QZeroConf::browserExists(void) +{ + if (pri->browser) + return true; + else + return false; +} diff --git a/avahicore.cpp b/avahicore.cpp index f98195a..ce9a202 100644 --- a/avahicore.cpp +++ b/avahicore.cpp @@ -311,6 +311,14 @@ void QZeroConf::stopServicePublish(void) } } +bool QZeroConf::publishExists(void) +{ + if (pri->group) + return true; + else + return false; +} + // http://www.zeroconf.org/rendezvous/txtrecords.html void QZeroConf::addServiceTxtRecord(QString nameOnly) @@ -354,3 +362,11 @@ void QZeroConf::stopBrowser(void) { pri->broswerCleanUp(); } + +bool QZeroConf::browserExists(void) +{ + if (pri->browser) + return true; + else + return false; +} diff --git a/bonjour.cpp b/bonjour.cpp index 4bb2355..7b43222 100644 --- a/bonjour.cpp +++ b/bonjour.cpp @@ -320,6 +320,14 @@ void QZeroConf::stopServicePublish(void) pri->cleanUp(pri->dnssRef); } +bool QZeroConf::publishExists(void) +{ + if (pri->dnssRef) + return true; + else + return false; +} + void QZeroConf::addServiceTxtRecord(QString nameOnly) { pri->txt.append((quint8) nameOnly.size()); @@ -376,3 +384,11 @@ void QZeroConf::stopBrowser(void) { pri->cleanUp(pri->browser); } + +bool QZeroConf::browserExists(void) +{ + if (pri->browser) + return true; + else + return false; +}