tmedicci commented on code in PR #8818:
URL: https://github.com/apache/nuttx/pull/8818#discussion_r1138561517
##########
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 */
+
+ ret = esp_wifi_set_mode(mode);
+ if (ret)
+ {
+ wlerr("Failed to set Wi-Fi mode=%d ret=%d\n", mode, ret);
+ ret = wifi_errno_trans(ret);
+ goto errout_set_mode;
+ }
+
+ ret = esp_wifi_start();
+ if (ret)
+ {
+ wlerr("Failed to start Wi-Fi with mode=%d ret=%d\n", mode, ret);
+ ret = wifi_errno_trans(ret);
+ goto errout_set_mode;
+ }
+
+ g_softap_started = true;
+
+ wlinfo("OK to start Wi-Fi SoftAP\n");
+
+ esp_wifi_lock(false);
+ return OK;
+
+errout_set_mode:
+ esp_wifi_lock(false);
+ return ret;
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]