You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "tmedicci (via GitHub)" <gi...@apache.org> on 2023/03/16 12:11:56 UTC

[GitHub] [nuttx] tmedicci commented on a diff in pull request #8818: esp32s3/wifi: add support to softAP (softAP and softAP + STA mode)

tmedicci commented on code in PR #8818:
URL: https://github.com/apache/nuttx/pull/8818#discussion_r1138554890


##########
arch/xtensa/src/esp32s3/esp32s3_wifi_adapter.c:
##########
@@ -4642,7 +4713,18 @@ int esp_wifi_sta_start(void)
       wlinfo("Failed to stop Wi-Fi ret=%d\n", ret);
     }
 
+#ifdef ESP32S3_WLAN_HAS_SOFTAP
+  if (g_softap_started)
+    {
+      mode = WIFI_MODE_APSTA;
+    }
+  else
+    {
+      mode = WIFI_MODE_STA;
+    }
+#else
   mode = WIFI_MODE_STA;
+#endif /* ESP32S3_WLAN_HAS_SOFTAP */

Review Comment:
   done ;)



##########
arch/xtensa/src/esp32s3/esp32s3_wifi_adapter.c:
##########
@@ -5645,6 +5923,802 @@ int esp_wifi_sta_rssi(struct iwreq *iwr, bool set)
 }
 #endif /* ESP32S3_WLAN_HAS_STA */
 
+/****************************************************************************
+ * SoftAP functions
+ ****************************************************************************/
+
+#ifdef ESP32S3_WLAN_HAS_SOFTAP
+
+/****************************************************************************
+ * Name: esp_wifi_softap_start
+ *
+ * Description:
+ *   Start Wi-Fi SoftAP.
+ *
+ * Input Parameters:
+ *   None
+ *
+ * Returned Value:
+ *   OK on success (positive non-zero values are cmd-specific)
+ *   Negated errno returned on failure.
+ *
+ ****************************************************************************/
+
+int esp_wifi_softap_start(void)
+{
+  int ret;
+  wifi_mode_t mode;
+
+  esp_wifi_lock(true);
+
+  ret = esp_wifi_stop();
+  if (ret)
+    {
+      wlinfo("Failed to stop Wi-Fi ret=%d\n", ret);
+    }
+
+#ifdef ESP32S3_WLAN_HAS_STA
+  if (g_sta_started)
+    {
+      mode = WIFI_MODE_APSTA;
+    }
+  else
+    {
+      mode = WIFI_MODE_AP;
+    }
+#else
+  mode = WIFI_MODE_AP;
+#endif /* ESP32S3_WLAN_HAS_STA */

Review Comment:
   done ;)



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

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