Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(net): Use network_event_handle_t for internal callbacks #11179

Merged
merged 2 commits into from
Mar 27, 2025

Conversation

me-no-dev
Copy link
Member

This pull request includes several changes aimed at improving event handling for network interfaces in the Ethernet, PPP, and WiFi libraries. The most important changes involve adding and managing event handles to ensure proper event registration and deregistration.

Event Handling Improvements:

  • libraries/Ethernet/src/ETH.cpp and libraries/Ethernet/src/ETH.h: Added _eth_connected_event_handle to handle Ethernet connection events. Updated methods to use this handle for event registration and removal. [1] [2] [3] [4] [5]

  • libraries/PPP/src/PPP.cpp and libraries/PPP/src/PPP.h: Introduced _ppp_event_handle to manage PPP connection events. Modified relevant methods to utilize this handle for event management. [1] [2] [3] [4]

  • libraries/WiFi/src/AP.cpp and libraries/WiFi/src/WiFiAP.h: Implemented _wifi_ap_event_handle for handling WiFi AP events. Adjusted methods to register and remove events using this handle. [1] [2] [3] [4]

  • libraries/WiFi/src/STA.cpp and libraries/WiFi/src/WiFiSTA.h: Added _wifi_sta_event_handle to manage WiFi STA events. Updated methods to handle event registration and removal with this handle. [1] [2] [3]

@me-no-dev me-no-dev added the Status: Review needed Issue or PR is awaiting review label Mar 25, 2025
@me-no-dev me-no-dev added this to the 3.2.0 milestone Mar 25, 2025
Copy link
Contributor

github-actions bot commented Mar 25, 2025

Messages
📖 🎉 Good Job! All checks are passing!

👋 Hello me-no-dev, we appreciate your contribution to this project!


📘 Please review the project's Contributions Guide for key guidelines on code, documentation, testing, and more.

🖊️ Please also make sure you have read and signed the Contributor License Agreement for this project.

Click to see more instructions ...


This automated output is generated by the PR linter DangerJS, which checks if your Pull Request meets the project's requirements and helps you fix potential issues.

DangerJS is triggered with each push event to a Pull Request and modify the contents of this comment.

Please consider the following:
- Danger mainly focuses on the PR structure and formatting and can't understand the meaning behind your code or changes.
- Danger is not a substitute for human code reviews; it's still important to request a code review from your colleagues.
- To manually retry these Danger checks, please navigate to the Actions tab and re-run last Danger workflow.

Review and merge process you can expect ...


We do welcome contributions in the form of bug reports, feature requests and pull requests.

1. An internal issue has been created for the PR, we assign it to the relevant engineer.
2. They review the PR and either approve it or ask you for changes or clarifications.
3. Once the GitHub PR is approved we do the final review, collect approvals from core owners and make sure all the automated tests are passing.
- At this point we may do some adjustments to the proposed change, or extend it by adding tests or documentation.
4. If the change is approved and passes the tests it is merged into the default branch.

Generated by 🚫 dangerJS against ce0a3bb

Copy link
Contributor

Memory usage test (comparing PR against master branch)

The table below shows the summary of memory usage change (decrease - increase) in bytes and percentage for each target.

MemoryFLASH [bytes]FLASH [%]RAM [bytes]RAM [%]
TargetDECINCDECINCDECINCDECINC
ESP32P4💚 -662⚠️ +276💚 -0.12⚠️ +0.040⚠️ +160.00⚠️ +0.06
ESP32S3💚 -716⚠️ +192💚 -0.12⚠️ +0.020⚠️ +160.00⚠️ +0.04
ESP32S2💚 -732⚠️ +200💚 -0.13⚠️ +0.020⚠️ +160.00⚠️ +0.04
ESP32C3💚 -656⚠️ +278💚 -0.11⚠️ +0.030⚠️ +160.00⚠️ +0.05
ESP32C6💚 -658⚠️ +278💚 -0.12⚠️ +0.030⚠️ +160.00⚠️ +0.04
ESP32H2💚 -6580💚 -0.120.00000.000.00
ESP32💚 -788⚠️ +192💚 -0.15⚠️ +0.020⚠️ +160.00⚠️ +0.04
Click to expand the detailed deltas report [usage change in BYTES]
TargetESP32P4ESP32S3ESP32S2ESP32C3ESP32C6ESP32H2ESP32
ExampleFLASHRAMFLASHRAMFLASHRAMFLASHRAMFLASHRAMFLASHRAMFLASHRAM
libraries/Ethernet/examples/ETH_TLK110💚 -662⚠️ +16----------💚 -7880
libraries/Ethernet/examples/ETH_W5500_Arduino_SPI💚 -658⚠️ +16💚 -7160💚 -7160💚 -6560💚 -6580💚 -6580💚 -7720
libraries/Ethernet/examples/ETH_W5500_IDF_SPI💚 -656⚠️ +16💚 -6960💚 -7200💚 -6560💚 -6560💚 -6560💚 -7760
libraries/Ethernet/examples/ETH_WIFI_BRIDGE💚 -658⚠️ +16💚 -688⚠️ +16💚 -732⚠️ +16💚 -654⚠️ +16💚 -6540--💚 -768⚠️ +16
libraries/PPP/examples/PPP_Basic💚 -6160💚 -6800💚 -6720💚 -6160💚 -6160💚 -6560💚 -6800
libraries/PPP/examples/PPP_WIFI_BRIDGE💚 -616⚠️ +16💚 -652⚠️ +16💚 -672⚠️ +16💚 -6220💚 -622⚠️ +16--💚 -6840
libraries/WiFi/examples/FTM/FTM_Initiator⚠️ +276⚠️ +16⚠️ +1680⚠️ +1920⚠️ +274⚠️ +16⚠️ +2760--⚠️ +1800
libraries/WiFi/examples/FTM/FTM_Responder⚠️ +276⚠️ +16⚠️ +1840⚠️ +1760⚠️ +276⚠️ +16⚠️ +2780--⚠️ +1840
libraries/WiFi/examples/SimpleWiFiServer⚠️ +272⚠️ +16⚠️ +1840⚠️ +1800⚠️ +2720⚠️ +2720--⚠️ +1840
libraries/WiFi/examples/WiFiAccessPoint⚠️ +274⚠️ +16⚠️ +1800⚠️ +1880⚠️ +2720⚠️ +2720--⚠️ +1880
libraries/WiFi/examples/WiFiClient⚠️ +272⚠️ +16⚠️ +1480⚠️ +1840⚠️ +272⚠️ +16⚠️ +2740--⚠️ +1760
libraries/WiFi/examples/WiFiClientBasic⚠️ +2740⚠️ +1800⚠️ +1840⚠️ +274⚠️ +16⚠️ +274⚠️ +16--⚠️ +1720
libraries/WiFi/examples/WiFiClientConnect⚠️ +272⚠️ +16⚠️ +1800⚠️ +1800⚠️ +274⚠️ +16⚠️ +2740--⚠️ +1800
libraries/WiFi/examples/WiFiClientEvents⚠️ +274⚠️ +16⚠️ +1480⚠️ +1760⚠️ +274⚠️ +16⚠️ +2760--⚠️ +1840
libraries/WiFi/examples/WiFiClientStaticIP⚠️ +274⚠️ +16⚠️ +1840⚠️ +1880⚠️ +2740⚠️ +2760--⚠️ +1800
libraries/WiFi/examples/WiFiExtender⚠️ +274⚠️ +16⚠️ +1520⚠️ +1840⚠️ +272⚠️ +16⚠️ +2760--⚠️ +1800
libraries/WiFi/examples/WiFiIPv6⚠️ +272⚠️ +16⚠️ +1800⚠️ +1880⚠️ +274⚠️ +16⚠️ +2740--⚠️ +1800
libraries/WiFi/examples/WiFiMulti⚠️ +2740⚠️ +1800⚠️ +1960⚠️ +274⚠️ +16⚠️ +274⚠️ +16--⚠️ +1920
libraries/WiFi/examples/WiFiMultiAdvanced⚠️ +2740⚠️ +1840⚠️ +1960⚠️ +274⚠️ +16⚠️ +276⚠️ +16--⚠️ +1800
libraries/WiFi/examples/WiFiScan⚠️ +274⚠️ +16⚠️ +1720⚠️ +1960⚠️ +274⚠️ +16⚠️ +2740--⚠️ +1800
libraries/WiFi/examples/WiFiScanAsync⚠️ +274⚠️ +16⚠️ +1800⚠️ +2000⚠️ +274⚠️ +16⚠️ +2740--⚠️ +1800
libraries/WiFi/examples/WiFiScanDualAntenna⚠️ +272⚠️ +16⚠️ +1720⚠️ +1920⚠️ +278⚠️ +16⚠️ +2740--⚠️ +1800
libraries/WiFi/examples/WiFiScanTime⚠️ +276⚠️ +16⚠️ +1840⚠️ +1960⚠️ +276⚠️ +16⚠️ +2760--⚠️ +1800
libraries/WiFi/examples/WiFiTelnetToSerial⚠️ +2740⚠️ +1840⚠️ +1880⚠️ +274⚠️ +16⚠️ +274⚠️ +16--⚠️ +1920
libraries/WiFi/examples/WiFiUDPClient⚠️ +272⚠️ +16⚠️ +1800⚠️ +1880⚠️ +2760⚠️ +2740--⚠️ +1920
libraries/WiFi/examples/WPS--⚠️ +1800⚠️ +1520⚠️ +274⚠️ +16⚠️ +2740--⚠️ +1720
libraries/WiFi/examples/WiFiBlueToothSwitch--⚠️ +1880--⚠️ +274⚠️ +16⚠️ +272⚠️ +16--⚠️ +1920
libraries/WiFi/examples/WiFiClientEnterprise--⚠️ +1800⚠️ +1800⚠️ +272⚠️ +16⚠️ +2740--⚠️ +1600
libraries/WiFi/examples/WiFiSmartConfig--⚠️ +1920⚠️ +1760⚠️ +276⚠️ +16⚠️ +2780--⚠️ +1480
libraries/Ethernet/examples/ETH_LAN8720------------💚 -7880

Copy link
Contributor

github-actions bot commented Mar 25, 2025

Test Results

 76 files   76 suites   12m 41s ⏱️
 38 tests  38 ✅ 0 💤 0 ❌
241 runs  241 ✅ 0 💤 0 ❌

Results for commit ce0a3bb.

♻️ This comment has been updated with latest results.

@SuGlider SuGlider self-requested a review March 27, 2025 02:22
Copy link
Collaborator

@SuGlider SuGlider left a comment

Choose a reason for hiding this comment

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

LGTM

@P-R-O-C-H-Y P-R-O-C-H-Y added Status: Pending Merge Pull Request is ready to be merged and removed Status: Review needed Issue or PR is awaiting review labels Mar 27, 2025
@me-no-dev me-no-dev merged commit 9dddc14 into master Mar 27, 2025
56 checks passed
@me-no-dev me-no-dev deleted the bugfix/arduino_event_handle branch March 27, 2025 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Pending Merge Pull Request is ready to be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants