Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
10 years, 4 months ago.
Ethernet Interface
if I dont't want to use DHCP ,what should I do?
Question relating to:
1 Answer
10 years, 4 months ago.
Hi zhang jun,
Once you have the Ethernet Interface library in your project, you should be able to expand the folder tree to see the classes - and by clicking on EthernetInterface in that view you can get access to the help.
There you will see:
static int init () Initialize the interface with DHCP. static int init (const char *ip, const char *mask, const char *gateway) Initialize the interface with a static IP address.
So, with no parameters, the init uses DHCP, but if you provide the parameters, it will attempt to init with them instead.
You might then bring your module online with:
net.init("192.168.1.240", "255.255.255.0", "192.168.1.1");