You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2020/10/30 08:01:58 UTC

[GitHub] [incubator-nuttx] masayuki2009 commented on a change in pull request #2175: gs2200m: Check disassociation from AP and enable rejoin

masayuki2009 commented on a change in pull request #2175:
URL: https://github.com/apache/incubator-nuttx/pull/2175#discussion_r514919817



##########
File path: drivers/wireless/gs2200m.c
##########
@@ -247,12 +248,17 @@ static const struct file_operations g_gs2200m_fops =
 static struct evt_code_s _evt_table[] =
 {
   {"OK", TYPE_OK},
+  {"Disassociation Event", TYPE_DISASSOCIATE},
+  {"DISASSOCIATED", TYPE_DISASSOCIATE},
   {"ERROR", TYPE_ERROR},
   {"DISCONNECT", TYPE_DISCONNECT},
   {"CONNECT", TYPE_CONNECT},
   {"Serial2WiFi APP", TYPE_BOOT_MSG}
 };
 
+static bool gs2200m_disassociate_flag = false;
+static struct gs2200m_assoc_msg reconnect_msg;
+

Review comment:
       Shall we add these variables into struct gs2200m_dev_s?
   

##########
File path: drivers/wireless/gs2200m.c
##########
@@ -3071,6 +3086,34 @@ static void gs2200m_irq_worker(FAR void *arg)
 
   t = gs2200m_recv_pkt(dev, pkt_dat);
 
+  if (true == gs2200m_disassociate_flag)
+    {
+      /* Disassociate recovery */
+
+      wlwarn("=== receive DISASSOCIATE\n");
+      dev->valid_cid_bits = 0;
+
+      gs2200m_disassociate(dev);
+      do

Review comment:
       Do we need to call gs2200m_disassociate() after we received a disassociation event?
   

##########
File path: drivers/wireless/gs2200m.c
##########
@@ -2573,6 +2584,8 @@ static int gs2200m_ioctl_assoc_sta(FAR struct gs2200m_dev_s *dev,
 {
   enum pkt_type_e t;
 
+  memcpy(&reconnect_msg, msg, sizeof(struct gs2200m_assoc_msg));
+

Review comment:
       Please add a comment such as "Remember assoc request msg for reconnection"
   

##########
File path: drivers/wireless/gs2200m.c
##########
@@ -247,12 +248,17 @@ static const struct file_operations g_gs2200m_fops =
 static struct evt_code_s _evt_table[] =
 {
   {"OK", TYPE_OK},
+  {"Disassociation Event", TYPE_DISASSOCIATE},
+  {"DISASSOCIATED", TYPE_DISASSOCIATE},

Review comment:
       Do we need both messages?
   When can we see each message?
   

##########
File path: drivers/wireless/gs2200m.c
##########
@@ -3071,6 +3086,34 @@ static void gs2200m_irq_worker(FAR void *arg)
 
   t = gs2200m_recv_pkt(dev, pkt_dat);
 
+  if (true == gs2200m_disassociate_flag)
+    {
+      /* Disassociate recovery */
+
+      wlwarn("=== receive DISASSOCIATE\n");
+      dev->valid_cid_bits = 0;
+
+      gs2200m_disassociate(dev);
+      do
+        {
+          while (gs2200m_recv_pkt(dev, pkt_dat) != TYPE_TIMEOUT)
+            {

Review comment:
       Do we have more packets to receive?
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org