W5500 driver for mbed OS 5

Dependents:   http-webserver-example mbed-os-example-sockets

Fork of W5500Interface by Sergei G

Revision:
17:60f75e78f35d
Parent:
16:380b4a629c4f
Child:
18:afec30f0922a
--- a/W5500Interface.cpp	Tue Aug 14 01:02:27 2018 +0000
+++ b/W5500Interface.cpp	Tue Aug 14 01:20:36 2018 +0000
@@ -91,6 +91,22 @@
     //_daemon->start(callback(this, &W5500Interface::daemon));
 }
 
+uint32_t W5500Interface:: 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;
+}
+
 int W5500Interface::init()
 {
     _dhcp_enable = true;