Ethernet IP

14 Nov 2010

Using the standard mbed's Ethernet class how can i attribute an IP adress to my mbed?

26 Nov 2010
Bruno you should include the Cookbook -> NetServices library, then something like this

#include "EthernetIf.h"

EthernetNetIf eth;

int main() 
{
    EthernetErr ethErr = eth.setup();       // thats using dhcp
    if( ethErr == ETH_OK )
    {
        IpAddr ip = eth.getIp();
        pc.printf("mbed IP Address is %d.%d.%d.%d\r\n", ip[0], ip[1], ip[2], ip[3]);
    }
    else pc.printf ("ETHERNETSETUP FAILED\n");

    etc