Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: NetRelais TCP_Client_Example TCP_Server_Example UDP_Server_Example ... more
address example
#include "mbed.h"
#include "EthernetInterface.h"
#include "NetworkAPI/ip/address.hpp"
int
main()
{
EthernetInterface interface;
interface.init();
interface.connect();
printf("IP Address is %s\n\r", interface.getIPAddress());
network::ip::Address localhost(network::ip::Address::Loopback);
printf(" - localhost: %s\n\r", localhost.toString().c_str());
network::ip::Address broadcast(network::ip::Address::Broadcast);
printf(" - broadcast: %s\n\r", broadcast.toString().c_str());
network::ip::Address linklocal("10.0.0.1");
printf(" - linklocal: %s\n\r", linklocal.toString().c_str());
network::ip::Address google;
google.fromHostname("www.google.com");
printf(" - www.google.com: %s\n\r", google.toString().c_str());
}