Skip to content

Conversation

@finger563
Copy link
Contributor

@finger563 finger563 commented Jan 20, 2026

Description

  • Update Wifi component so that WifiSta and WifiAP initialization and deinitialization do not have unintended side effects

Motivation and Context

This PR ensures that stopping the WifiSta does not inadvertently stop the WifiAP if it is running, and vice versa. This is important for applications that require both modes to be active simultaneously, such as when a device needs to connect to an existing network while also providing its own access point for other devices.

How has this been tested?

Tested on ESP32 hardware with both WifiSta and WifiAP running concurrently. Verified that stopping one mode does not affect the other. Conducted multiple start/stop cycles to ensure stability and reliability.

Screenshots (if appropriate, e.g. schematic, board, console logs, lab pictures):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update
  • Hardware (schematic, board, system design) change
  • Software change

Checklist:

  • My change requires a change to the documentation.
  • I have added / updated the documentation related to this change via either README or WIKI

Software

  • I have added tests to cover my changes.
  • I have updated the .github/workflows/build.yml file to add my new test to the automated cloud build github action.
  • All new and existing tests passed.
  • My code follows the code style of this project.

Copilot AI review requested due to automatic review settings January 20, 2026 05:07
@github-actions
Copy link

✅Static analysis result - no issues found! ✅

@finger563 finger563 self-assigned this Jan 20, 2026
@finger563 finger563 added enhancement New feature or request wifi labels Jan 20, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves WiFi STA (Station) and AP (Access Point) initialization and deinitialization to better support simultaneous operation (APSTA mode). The changes allow both STA and AP to coexist without interfering with each other during startup and shutdown.

Changes:

  • Modified WifiSta and WifiAp classes to detect and preserve existing WiFi modes when initializing
  • Updated stop/destructor logic to transition between APSTA↔STA and APSTA↔AP modes rather than fully stopping WiFi
  • Changed CMakeLists.txt dependencies from PRIV_REQUIRES to REQUIRES to properly expose WiFi types in public headers

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
components/wifi/include/wifi_sta.hpp Added logic to detect current WiFi mode during init and deinit, allowing STA to coexist with AP mode
components/wifi/include/wifi_ap.hpp Added logic to detect current WiFi mode during init and stop, allowing AP to coexist with STA mode
components/wifi/CMakeLists.txt Changed dependencies from PRIV_REQUIRES to REQUIRES to expose WiFi types to dependent components

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@finger563 finger563 merged commit f155f4f into main Jan 22, 2026
102 checks passed
@finger563 finger563 deleted the feat/wifi-improvements branch January 22, 2026 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request wifi

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants