Skip to content

matisszilard/spark-core-mdns

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 

Repository files navigation

spark-core-mdns

Multicast DNS and DNS-SD for the Spark Core

Example

Register a service on HTTP port 80:

#define HTTP_PORT 80

MDNS mdns;

void setup() {

    // Wait for WiFi to connect
    while (!WiFi.ready()) {
      // empty
    }

    bool success = mdns.setHostname("myservice");
    if (success) {
      success = mdns.addService("tcp", "http", HTTP_PORT, "MyService");
    }
    mdns.addTXTEntry("normal");

    if (success) {
      success = mdns.begin();
    }
}

void loop() {
  mdns.processQueries();

  // Do your magic stuff here :)
}

For more examples please take a look here

Packages

No packages published

Languages

  • C++ 95.1%
  • Other 4.9%