Bonjour/Zerconf library

Dependencies:   mbed

Revision:
0:355018f44c9f
Child:
1:59820ca5c83a
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Jul 21 19:25:56 2010 +0000
@@ -0,0 +1,29 @@
+#include "mbed.h"
+
+// Ethernet, DHCP
+#include "EthernetNetIf.h"
+
+// mDNS response to announce oneselve
+#include "services/mDNS/mDNSResponder.h"
+
+DigitalOut myled(LED1);
+EthernetNetIf eth;
+mDNSResponder mdns;
+
+int main() {
+    EthernetErr ethErr = eth.setup();
+    if (ethErr) {
+        printf("Error %d in setup on DHCP.\r\n", ethErr);
+        return -1;
+    }
+    printf("Trying to get IP address\r\n");
+    IpAddr ip = eth.getIp();
+    printf("mbed IP Address is %d.%d.%d.%d\r\n", ip[0], ip[1], ip[2], ip[3]);
+
+    mdns.announce(ip, "_http._tcp", 80, "May the blood run free", "path=/sample");
+
+    printf("Entering while loop Net::poll()ing\r\n");
+    while (1) {
+        Net::poll();
+    }
+}