friendev EtherDune TCP/IP library
Public Member Functions | List of all members
DHCP Class Reference

EtherDune DHCP Service. More...

#include <DHCP.h>

Inheritance diagram for DHCP:
UDPSocket Stateful

Public Member Functions

 DHCP ()
 
bool dhcpSetup ()
 Attempts to configure the IP settings: local IP, subnet mask, gateway and DNS via DHCP. More...
 

Detailed Description

EtherDune DHCP Service.

Implements the basics of DHCP so as to obtain and maintain an IP lease along with DNS, gateway IP and netmask. See DHCP configuration and timeouts for EtherDune config parameters that apply to DHCP.

EtherDune DHCP is a crude "straight to the point" implementation of DHCP. It does not implement a full RENEW/REBIND cycle, but rather shortcuts the whole process fully renewing the lease once the timeout expires. This simplifies the implementation saving valuable flash/code space.

In order to use DHCP in your project, instantiate an object of this class, call dhcpSetup and keep the object instance alive for as long as you want to keep the lease active.

If you do not instantiate the DHCP class in your code, it will not be compiled in, therefore not affecting your code size if unused.

Definition at line 122 of file DHCP.h.

Constructor & Destructor Documentation

DHCP::DHCP ( )

Definition at line 25 of file DHCP.cpp.

Member Function Documentation

bool DHCP::dhcpSetup ( )

Attempts to configure the IP settings: local IP, subnet mask, gateway and DNS via DHCP.

This call will block until EtherDune is configured or timeout and return false.

Returns
true if successful, false otherwise.

Definition at line 50 of file DHCP.cpp.


The documentation for this class was generated from the following files: