| 19 | |
| 20 | #if defined(WIZ550io_WITH_MACADDRESS) |
| 21 | int EthernetClass::begin(void) |
| 22 | { |
| 23 | byte mac_address[6] ={0,}; |
| 24 | if (_dhcp != NULL) { |
| 25 | delete _dhcp; |
| 26 | } |
| 27 | _dhcp = new DhcpClass(); |
| 28 | |
| 29 | // Initialise the basic info |
| 30 | w5500.init(w5500_cspin); |
| 31 | w5500.setIPAddress(IPAddress(0,0,0,0).raw_address()); |
| 32 | w5500.getMACAddress(mac_address); |
| 33 | |
| 34 | // Now try to get our config info from a DHCP server |
| 35 | int ret = _dhcp->beginWithDHCP(mac_address); |
| 36 | if(ret == 1) |
| 37 | { |
| 38 | // We've successfully found a DHCP server and got our configuration info, so set things |
| 39 | // accordingly |
| 40 | w5500.setIPAddress(_dhcp->getLocalIp().raw_address()); |
| 41 | w5500.setGatewayIp(_dhcp->getGatewayIp().raw_address()); |
| 42 | w5500.setSubnetMask(_dhcp->getSubnetMask().raw_address()); |
| 43 | _dnsServerAddress = _dhcp->getDnsServerIp(); |
| 44 | _dnsDomainName = _dhcp->getDnsDomainName(); |
| 45 | _hostName = _dhcp->getHostName(); |
| 46 | } |
| 47 | |
| 48 | return ret; |
| 49 | } |
| 50 | |
| 51 | void EthernetClass::begin(IPAddress local_ip) |
| 52 | { |
nothing calls this directly
no test coverage detected