2013-07-25 12:03:31 +02:00
|
|
|
#ifndef ZEROCONF_SERVICE
|
|
|
|
#define ZEROCONF_SERVICE
|
|
|
|
|
|
|
|
#include <string>
|
2013-07-25 15:45:19 +02:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
2013-07-25 12:03:31 +02:00
|
|
|
|
2013-07-25 15:45:19 +02:00
|
|
|
/**
|
|
|
|
* The port for use for the main communication between LibO and remote control app.
|
|
|
|
*/
|
|
|
|
#define PORT_DISCOVERY 1598
|
|
|
|
#define BUFFER_SIZE 200
|
2013-07-25 12:03:31 +02:00
|
|
|
|
2013-07-25 15:45:19 +02:00
|
|
|
#define CHARSET RTL_TEXTENCODING_UTF8
|
|
|
|
|
|
|
|
struct sockaddr_in;
|
|
|
|
|
2013-07-25 17:27:10 +02:00
|
|
|
typedef unsigned int uint;
|
|
|
|
|
2013-07-25 15:45:19 +02:00
|
|
|
namespace sd{
|
|
|
|
|
|
|
|
class ZeroconfService
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
std::string name;
|
|
|
|
uint port;
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit ZeroconfService(const std::string& aname, uint aport)
|
|
|
|
:name(aname), port(aport){}
|
2013-07-25 17:23:25 +01:00
|
|
|
virtual ~ZeroconfService(){}
|
2013-07-25 15:45:19 +02:00
|
|
|
|
|
|
|
std::string getName() const {return name;}
|
|
|
|
void setName(const char * n) {name = n;}
|
|
|
|
uint getPort() const {return port;}
|
|
|
|
|
|
|
|
// Clean up the service when closing
|
|
|
|
virtual void clear() = 0;
|
|
|
|
// Bonjour for OSX, Avahi for Linux
|
|
|
|
virtual void setup() = 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
2013-07-25 12:03:31 +02:00
|
|
|
#endif
|