User manual

Table Of Contents
mikroC PRO for PIC32
MikroElektronika
457
SPI_Ethernet_renewDHCP
Prototype
unsigned int SPI_Ethernet_renewDHCP(unsigned char tmax);
Description This is DHCP module routine. It sends IP address lease time renewal request to DHCP server.
Parameters - tmax: time in seconds to wait for an reply.
Returns - 1 - upon success (lease time was renewed).
- 0 - otherwise (renewal request timed out).
Requires Ethernet module has to be initialized. See SPI_Ethernet_Init.
Example
while(1) {
...
if (SPI_Ethernet_doDHCPLeaseTime())
SPI_Ethernet_renewDHCP(5); // it’s time to renew the IP address lease,
with 5 secs for a reply
...
}
Notes None.