Darran Shepherd / Mbed 2 deprecated Bonjour

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 #include "EthernetNetIf.h"
00003 
00004 DigitalOut myled(LED1);
00005 
00006 EthernetNetIf eth;
00007 
00008 int main() {
00009     EthernetErr ethErr = eth.setup();
00010     if (ethErr) {
00011         printf("Error %d in setup on DHCP.\r\n", ethErr);
00012         return -1;
00013     }
00014     printf("Trying to get IP address\r\n");
00015     IpAddr ip = eth.getIp();
00016     printf("mbed IP Address is %d.%d.%d.%d\r\n", ip[0], ip[1], ip[2], ip[3]);
00017 
00018     printf("Entering while loop Net::poll()ing\r\n");
00019     while (1) {
00020         Net::poll();
00021     }
00022 }