mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2024-11-22 23:56:13 +01:00
25 lines
479 B
C++
25 lines
479 B
C++
|
|
#define BROADCASTTIME 15 //seconds
|
|
|
|
typedef enum _MDNSServiceProtocol_t
|
|
{
|
|
MDNSServiceTCP,
|
|
MDNSServiceUDP
|
|
} MDNSServiceProtocol_t;
|
|
|
|
class MDNS {
|
|
public:
|
|
MDNS(EthernetUDP& udp);
|
|
~MDNS();
|
|
int begin(const IPAddress& ip, char* name);
|
|
int addServiceRecord(const char* name, uint16_t port, MDNSServiceProtocol_t proto);
|
|
void run();
|
|
private:
|
|
EthernetUDP *_udp;
|
|
IPAddress _ipAddress;
|
|
char* _name;
|
|
char* _serviceName;
|
|
char* _serviceProto;
|
|
int _servicePort;
|
|
};
|