You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by je...@apache.org on 2020/04/14 09:22:17 UTC

[incubator-nuttx-apps] 01/02: wireless: gs2200m: Add support for UDP connect in gs2200m_main.c

This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git

commit c1267327993ee9e6716cd2c9b57e8c4e91bd2c68
Author: Masayuki Ishikawa <ma...@gmail.com>
AuthorDate: Tue Apr 14 17:02:49 2020 +0900

    wireless: gs2200m: Add support for UDP connect in gs2200m_main.c
    
    NOTE: gs2200m driver needs to be updated as well
    
    Signed-off-by: Masayuki Ishikawa <Ma...@jp.sony.com>
---
 wireless/gs2200m/gs2200m_main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/wireless/gs2200m/gs2200m_main.c b/wireless/gs2200m/gs2200m_main.c
index a2f05e1..1b7f29f 100644
--- a/wireless/gs2200m/gs2200m_main.c
+++ b/wireless/gs2200m/gs2200m_main.c
@@ -650,6 +650,7 @@ static int connect_request(int fd, FAR struct gs2200m_s *priv,
            ntohs(addr.sin_port));
 
   cmsg.cid  = 'z'; /* set to invalid */
+  cmsg.type = usock->type;
 
   ret = ioctl(priv->gsfd, GS2200M_IOC_CONNECT,
               (unsigned long)&cmsg);
@@ -744,7 +745,7 @@ static int sendto_request(int fd, FAR struct gs2200m_s *priv,
 
   /* For UDP, addlen must be provided */
 
-  if (usock->type == SOCK_DGRAM)
+  if (usock->type == SOCK_DGRAM && CONNECTED != usock->state)
     {
       if (req->addrlen == 0)
         {