123

Fork of WizFi250Interface_1 by cliff Hong

Revision:
1:046a828fe0d2
Parent:
0:e3dc9e54a15b
--- a/WizFi250Interface.h	Tue Aug 30 00:05:24 2016 +0000
+++ b/WizFi250Interface.h	Fri Aug 18 05:52:17 2017 +0000
@@ -17,7 +17,7 @@
 #ifndef WIZFI250_INTERFACE_H
 #define WIZFI250_INTERFACE_H
 
-#include "WiFiInterface.h"
+#include "mbed.h"
 #include "WizFi250.h"
 
 #define WIZFI250_SOCKET_COUNT 8
@@ -29,15 +29,23 @@
 {
 public:
     WizFi250Interface(PinName tx, PinName rx, PinName cts, PinName rts, PinName reset, PinName alarm, int baud=115200 );
+    
+    virtual int connect();
 
     virtual int connect(
         const char *ssid,
         const char *pass,
-        nsapi_security_t security = NSAPI_SECURITY_NONE);
+        nsapi_security_t security = NSAPI_SECURITY_NONE, 
+        uint8_t channel = 0);
 
     /** Stop the interface
      *  @return             0 on success, negative on failure
      */
+     
+     virtual int set_credentials(const char *ssid, const char *pass, nsapi_security_t security = NSAPI_SECURITY_NONE);
+     
+     virtual int set_channel(uint8_t channel);
+     
     virtual int disconnect();
 
     /** Get the internally stored IP address
@@ -49,6 +57,18 @@
      *  @return             MAC address of the interface
      */
     virtual const char *get_mac_address();
+    
+    virtual const char *get_gateway() { };
+    
+    virtual const char *get_netmask() { };
+    
+    virtual int8_t get_rssi() { };
+    
+    
+    virtual int scan(WiFiAccessPoint *res, unsigned count) { };    
+    
+    using NetworkInterface::gethostbyname;
+    using NetworkInterface::add_dns_server;
 
 protected:
     /** Open a socket
@@ -95,7 +115,8 @@
      *  @note This call is not-blocking, if this call would block, must
      *        immediately return NSAPI_ERROR_WOULD_WAIT
      */
-    virtual int socket_accept(void **handle, void *server);
+    //virtual int socket_accept(void **handle, void *server);
+    virtual int socket_accept(void *handle, void **socket, SocketAddress *address);
 
     /** Send data to the remote host
      *  @param handle       Socket handle
@@ -148,6 +169,11 @@
      *  @note Callback may be called in an interrupt context.
      */
     virtual void socket_attach(void *handle, void (*callback)(void *), void *data);
+    
+    virtual NetworkStack *get_stack()
+    {
+        return this;
+    }
 
 private:
     WizFi250 _wizfi250;