Minsu Lee / WizFi250Interface

Dependents:   WizFi250_AP_HelloWorld

Fork of WizFi250Interface by DongEun Koak

Files at this revision

API Documentation at this revision

Comitter:
kaizen
Date:
Thu Jun 25 05:16:39 2015 +0000
Parent:
11:e52b91d1a5d5
Child:
13:0b8e51d3c0e8
Commit message:
Modified recv_from function of UDP.

Changed in this revision

Socket/UDPSocket.cpp Show annotated file Show diff for this revision Revisions of this file
WizFi250/WizFi250_msg.cpp Show annotated file Show diff for this revision Revisions of this file
WizFi250/WizFi250_sock.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/Socket/UDPSocket.cpp	Wed Jun 24 06:25:56 2015 +0000
+++ b/Socket/UDPSocket.cpp	Thu Jun 25 05:16:39 2015 +0000
@@ -39,7 +39,7 @@
 int UDPSocket::bind(int port)
 {
     _port = port;
-    _server = true;
+    //_server = true;
     return 0;
 }
 
@@ -123,6 +123,14 @@
             return -1;
         }
     }
+    else
+    {
+        if(!_wizfi250->readable(_cid))
+        {
+            return 0;
+        }
+    }
+   
 
     tmr.reset();
     time = -1;
@@ -136,19 +144,17 @@
         }
         else
         {
-            idx += _wizfi250->recv(_cid, &buffer[idx], length - idx);
+            //idx += _wizfi250->recv(_cid, &buffer[idx], length - idx);
+            idx += _wizfi250->recvfrom(_cid, &buffer[idx], length - idx, ip, &port);
         }
 
         if (idx == length)
             break;
 
+        
         time = tmr.read_ms();
     }
 
-    if (_server)
-    {
-        remote.set_address(ip, port);
-    }
-
+    remote.set_address(ip, port);
     return (idx==0) ? -1 : idx;
 }
--- a/WizFi250/WizFi250_msg.cpp	Wed Jun 24 06:25:56 2015 +0000
+++ b/WizFi250/WizFi250_msg.cpp	Thu Jun 25 05:16:39 2015 +0000
@@ -1,5 +1,5 @@
 /*
- /* Copyright (C) 2013 gsfan, MIT License
+/* Copyright (C) 2013 gsfan, MIT License
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
  * and associated documentation files (the "Software"), to deal in the Software without restriction,
--- a/WizFi250/WizFi250_sock.cpp	Wed Jun 24 06:25:56 2015 +0000
+++ b/WizFi250/WizFi250_sock.cpp	Thu Jun 25 05:16:39 2015 +0000
@@ -1,5 +1,5 @@
 /*
- /* Copyright (C) 2013 gsfan, MIT License
+/* Copyright (C) 2013 gsfan, MIT License
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
  * and associated documentation files (the "Software"), to deal in the Software without restriction,