First step: AutoIP compiled in and working

Dependencies:   mbed

Committer:
darran
Date:
Fri Jun 18 15:54:21 2010 +0000
Revision:
1:4218cacaf696
Parent:
0:55a05330f8cc

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
darran 0:55a05330f8cc 1 #include "mbed.h"
darran 0:55a05330f8cc 2 #include "EthernetNetIf.h"
darran 0:55a05330f8cc 3
darran 0:55a05330f8cc 4 DigitalOut myled(LED1);
darran 0:55a05330f8cc 5
darran 0:55a05330f8cc 6 EthernetNetIf eth;
darran 0:55a05330f8cc 7
darran 0:55a05330f8cc 8 int main() {
darran 0:55a05330f8cc 9 EthernetErr ethErr = eth.setup();
darran 0:55a05330f8cc 10 if (ethErr) {
darran 0:55a05330f8cc 11 printf("Error %d in setup on DHCP.\r\n", ethErr);
darran 0:55a05330f8cc 12 return -1;
darran 0:55a05330f8cc 13 }
darran 0:55a05330f8cc 14 printf("Trying to get IP address\r\n");
darran 0:55a05330f8cc 15 IpAddr ip = eth.getIp();
darran 0:55a05330f8cc 16 printf("mbed IP Address is %d.%d.%d.%d\r\n", ip[0], ip[1], ip[2], ip[3]);
darran 0:55a05330f8cc 17
darran 0:55a05330f8cc 18 printf("Entering while loop Net::poll()ing\r\n");
darran 0:55a05330f8cc 19 while (1) {
darran 0:55a05330f8cc 20 Net::poll();
darran 0:55a05330f8cc 21 }
darran 0:55a05330f8cc 22 }