-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #33 from pothosware/dnssd_avahi
DNS-SD avahi
- Loading branch information
Showing
14 changed files
with
908 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
find_library(AVAHI_LIBRARY-COMMON NAMES avahi-common) | ||
find_library(AVAHI_LIBRARY-CLIENT NAMES avahi-client) | ||
find_path(AVAHI_INCLUDE_DIR avahi-client/publish.h) | ||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args(Avahi DEFAULT_MSG AVAHI_LIBRARY-COMMON AVAHI_LIBRARY-CLIENT AVAHI_INCLUDE_DIR) | ||
if(AVAHI_FOUND) | ||
set(AVAHI_LIBRARIES ${AVAHI_LIBRARY-COMMON} ${AVAHI_LIBRARY-CLIENT}) | ||
set(AVAHI_INCLUDE_DIRS ${AVAHI_INCLUDE_DIR}) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// Copyright (c) 2018-2018 Josh Blum | ||
// SPDX-License-Identifier: BSL-1.0 | ||
|
||
#pragma once | ||
#include <string> | ||
#include <map> | ||
|
||
#define SOAPY_REMOTE_DNSSD_NAME "SoapyRemote" | ||
|
||
#define SOAPY_REMOTE_DNSSD_TYPE "_soapy._tcp" | ||
|
||
struct SoapyMDNSEndpointData; | ||
|
||
/*! | ||
* The DNS-SD client ties into the system's mDNS daemon. | ||
* Used for both server side for publishing, | ||
* and the client side for browsing/lookup. | ||
*/ | ||
class SoapyMDNSEndpoint | ||
{ | ||
public: | ||
|
||
//! Connect to the daemon | ||
SoapyMDNSEndpoint(void); | ||
|
||
//! Disconnect from the daemon | ||
~SoapyMDNSEndpoint(void); | ||
|
||
//! Print information about the client | ||
void printInfo(void); | ||
|
||
//! Is the client connected and operational? | ||
bool status(void); | ||
|
||
/*! | ||
* Allow the endpoint to advertise that its running the RPC service | ||
*/ | ||
void registerService(const std::string &uuid, const std::string &service, const int ipVer); | ||
|
||
/*! | ||
* Get a list of all active server URLs. | ||
* \param ipVer the preferred IP version to discover | ||
* \return a mapping of server UUIDs to host URLs | ||
*/ | ||
std::map<std::string, std::map<int, std::string>> getServerURLs(const int ipVer, const long timeoutUs); | ||
|
||
private: | ||
SoapyMDNSEndpointData *_impl; | ||
}; |
Oops, something went wrong.