Darran Shepherd
/
Bonjour
First step: AutoIP compiled in and working
Diff: main.cpp
- Revision:
- 0:55a05330f8cc
- Child:
- 1:4218cacaf696
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Fri Jun 18 09:11:35 2010 +0000 @@ -0,0 +1,26 @@ +#include "mbed.h" +#include "EthernetNetIf.h" + +DigitalOut myled(LED1); + +EthernetNetIf eth; + +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]); + + printf("Entering while loop Net::poll()ing\r\n"); + while (1) { + Net::poll(); + myled = 1; + wait(0.2); + myled = 0; + wait(0.2); + } +}