modified by ohneta

Dependents:   HelloESP8266Interface_mine

Fork of NetworkSocketAPI by NetworkSocketAPI

Revision:
7:b147c08301be
Parent:
6:7437289cb2e9
Child:
10:50b0a3f840df
--- a/NetworkInterface.h	Mon Jun 01 16:21:59 2015 -0500
+++ b/NetworkInterface.h	Wed Jun 17 20:56:15 2015 +0000
@@ -17,83 +17,66 @@
 #ifndef NETWORKINTERFACE_H
 #define NETWORKINTERFACE_H
 
+#include "stdint.h"
+
 /** NetworkInterface class.
- *   This is a common interface that is shared between all hardware that connect
- *   to a network over IP.
+    This is a common interface that is shared between all hardware that connect
+    to a network over IP.
  */
 class NetworkInterface
 {
 public:
 
-    /**
-     *    Initialize the network interface with DHCP.
-     *
-     *    \returns 0 on success, a negative number on failure
+    /** Initialize the network interface with DHCP.
+        @returns 0 on success, a negative number on failure
      */
-    virtual int init(void) const = 0;
+    virtual int32_t init(void) const = 0;
 
-    /**
-     *    Initialize the network interface with a static IP address.
-     *
-     *    @param ip The static IP address to use
-     *    @param mask The IP address mask
-     *    @param gateway The gateway to use
-     *
-     *    \returns 0 on success, a negative number on failure
+    /** Initialize the network interface with a static IP address.
+        @param ip The static IP address to use
+        @param mask The IP address mask
+        @param gateway The gateway to use
+        @returns 0 on success, a negative number on failure
      */
-    int init(const char *ip, const char *mask, const char *gateway) const = 0;
+    virtual int32_t init(const char *ip, const char *mask, const char *gateway) const = 0;
+    
 
-    /**
-     *    Start the interface, using DHCP if needed.
-     *
-     *    @param timeout_ms Time in miliseconds to wait while attempting to connect before timing out
-     *
-     *    \returns 0 on success, a negative number on failure
+    /** Start the interface, using DHCP if needed.
+        @param timeout_ms Time in miliseconds to wait while attempting to connect before timing out
+        @returns 0 on success, a negative number on failure
      */
-    virtual int connect(const unsigned int timeout_ms=15000) const = 0;
+    virtual int32_t connect(uint32_t timeout_ms=15000) const = 0;
 
-    /**
-     *    Stop the interface, bringing down dhcp if necessary.
-     *
-     *    \returns 0 on success, a negative number on failure
+    /** Stop the interface, bringing down dhcp if necessary.
+        @returns 0 on success, a negative number on failure
      */
-    virtual int disconnect(void) const = 0;
+    virtual int32_t disconnect(void) const = 0;
 
-    /**
-     *    Get the current IP address.
-     *
-     *    \returns a pointer to a string containing the IP address.
+    /** Get the current IP address.
+        @returns a pointer to a string containing the IP address.
      */
     virtual char *getIPAddress(void) const = 0;
 
-    /**
-     *    Get the current gateway address.
-     *
-     *    \returns a pointer to a string containing the gateway address.
+    /** Get the current gateway address.
+        @returns a pointer to a string containing the gateway address.
      */
     virtual char *getGateway(void) const = 0;
 
 
-    /**
-     *    Get the current network mask.
-     *
-     *    \returns a pointer to a string containing the network mask.
+    /** Get the current network mask.
+        @returns a pointer to a string containing the network mask.
      */
     virtual char *getNetworkMask(void) const = 0;
 
-    /**
-     *    Get the devices MAC address.
-     *
-     *    \returns a pointer to a string containing the mac address.
+    /** Get the devices MAC address.
+        @returns a pointer to a string containing the mac address.
      */
     virtual char *getMACAddress(void) const = 0;
 
-    /**
-     *    Get the current status of the interface connection.
-     *
-     *    \returns true if connected, false otherwise.
+    /** Get the current status of the interface connection.
+        @returns true if connected, a negative number on failure
      */
-    virtual int isConnected(void) const = 0;
+    virtual int32_t isConnected(void) const = 0;
 };
 
 #endif