W5500 driver for mbed OS 5
Dependents: http-webserver-example mbed-os-example-sockets
Fork of W5500Interface by
Diff: WIZnet/W5500.cpp
- Revision:
- 17:60f75e78f35d
- Parent:
- 11:5118c2bff025
- Child:
- 18:afec30f0922a
--- a/WIZnet/W5500.cpp Tue Aug 14 01:02:27 2018 +0000 +++ b/WIZnet/W5500.cpp Tue Aug 14 01:20:36 2018 +0000 @@ -41,7 +41,6 @@ cs = 1; reset_pin = 1; inst = this; - dhcp = false; } /* @@ -52,7 +51,6 @@ cs = 1; reset_pin = 1; inst = this; - dhcp = false; } */ @@ -116,25 +114,6 @@ return true; } -bool WIZnet_Chip::gethostbyname(const char* host, uint32_t* ip) -{ -#if 0 - uint32_t addr = str_to_ip(host); - char buf[17]; - snprintf(buf, sizeof(buf), "%d.%d.%d.%d", (addr>>24)&0xff, (addr>>16)&0xff, (addr>>8)&0xff, addr&0xff); - if (strcmp(buf, host) == 0) { - *ip = addr; - return true; - } - DNSClient client; - if(client.lookup(host)) { - *ip = client.ip; - return true; - } -#endif - return false; -} - bool WIZnet_Chip::disconnect() { return true; @@ -401,23 +380,7 @@ #endif spi->unlock(); } - -uint32_t str_to_ip(const char* str) -{ - uint32_t ip = 0; - char* p = (char*)str; - for(int i = 0; i < 4; i++) { - ip |= atoi(p); - p = strchr(p, '.'); - if (p == NULL) { - break; - } - ip <<= 8; - p++; - } - return ip; -} - +/* void printfBytes(char* str, uint8_t* buf, int len) { printf("%s %d:", str, len); @@ -454,5 +417,5 @@ } debug("\n"); } - +*/ #endif