Christopher Haster / ESP8266Interface

Dependencies:   ESP8266

Fork of ESP8266Interface by NetworkSocketAPI

Files at this revision

API Documentation at this revision

Comitter:
Christopher Haster
Date:
Thu Feb 25 03:34:36 2016 -0600
Branch:
api-changes
Parent:
45:538e5ce2f0d3
Child:
47:60a4b49e8b83
Commit message:
Removed storing IP address locally

Changed in this revision

ESP8266Interface.cpp Show annotated file Show diff for this revision Revisions of this file
ESP8266Interface.h Show annotated file Show diff for this revision Revisions of this file
--- a/ESP8266Interface.cpp	Thu Feb 25 03:32:37 2016 -0600
+++ b/ESP8266Interface.cpp	Thu Feb 25 03:34:36 2016 -0600
@@ -83,10 +83,8 @@
         return NS_ERROR_NO_CONNECTION;
     }
 
-    _ip_address = _esp.getIPAddress();
-    _mac_address = _esp.getMACAddress();
-    if (!_ip_address || !_mac_address) {
-        return NS_ERROR_NO_ADDRESS;
+    if (!_esp.getIPAddress()) {
+        return NS_ERROR_DHCP_FAILURE;
     }
 
     return 0;
@@ -105,12 +103,12 @@
 
 const char *ESP8266Interface::getIPAddress()
 {
-    return _ip_address;
+    return _esp.getIPAddress();
 }
 
 const char *ESP8266Interface::getMACAddress()
 {
-    return _mac_address;
+    return _esp.getMACAddress();
 }
 
 SocketInterface *ESP8266Interface::createSocket(socket_protocol_t proto)
--- a/ESP8266Interface.h	Thu Feb 25 03:32:37 2016 -0600
+++ b/ESP8266Interface.h	Thu Feb 25 03:34:36 2016 -0600
@@ -49,10 +49,7 @@
 
 private:
     ESP8266 _esp;
-    
     bool _ids[ESP8266_SOCKET_COUNT];
-    const char *_ip_address;
-    const char *_mac_address;
 };