MCPcopy Create free account
hub / github.com/DanielOgorchock/ST_Anything / beginWithDHCP

Method beginWithDHCP

Arduino/libraries/Ethernet2/src/Dhcp.cpp:12–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10#include "utility/util.h"
11
12int DhcpClass::beginWithDHCP(uint8_t *mac, unsigned long timeout, unsigned long responseTimeout)
13{
14 _dhcpLeaseTime=0;
15 _dhcpT1=0;
16 _dhcpT2=0;
17 _lastCheck=0;
18 _timeout = timeout;
19 _responseTimeout = responseTimeout;
20
21 // zero out _dhcpMacAddr
22 memset(_dhcpMacAddr, 0, 6);
23 reset_DHCP_lease();
24
25 memcpy((void*)_dhcpMacAddr, (void*)mac, 6);
26 _dhcp_state = STATE_DHCP_START;
27 return request_DHCP_lease();
28}
29
30void DhcpClass::reset_DHCP_lease(){
31 // zero out _dhcpSubnetMask, _dhcpGatewayIp, _dhcpLocalIp, _dhcpDhcpServerIp, _dhcpDnsServerIp

Callers 1

beginMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected