Skip to content

Add and Leverage Linux Connectivity Callback Introspection, Mutation, and Action Delegation Methods#43062

Merged
mergify[bot] merged 9 commits intoproject-chip:masterfrom
Nuovations:user/gerickson/github-issue-42516-connectivity-callback-support-methods
Mar 13, 2026
Merged

Add and Leverage Linux Connectivity Callback Introspection, Mutation, and Action Delegation Methods#43062
mergify[bot] merged 9 commits intoproject-chip:masterfrom
Nuovations:user/gerickson/github-issue-42516-connectivity-callback-support-methods

Conversation

@gerickson
Copy link
Copy Markdown
Contributor

@gerickson gerickson commented Feb 10, 2026

Summary

This adds two new callback setters as peers to the existing SetNetworkStatusChangeCallback:

  1. SetConnectCallback
  2. SetScanCallback

and adds three new callback-related action delegation methods:

  1. OnConnectResult
  2. OnScanFinished
  3. OnStatusChange

and adds two new callback-related introspection methods:

  1. IsWiFiStationConnecting
  2. IsWiFiStationScanning

The three action delegation methods consolidate the handling and dispatch of scan, connect, and network status change action delegation callback invocation and, for scan and connect, post-invocation nullification.

Collectively, these seven methods not only make it easier to keep common callback members private as implementations fan out from the current, single wpa_supplicant implementation but also reduces duplication among those implementations for common callback-related operations.

Related issues

#42516

Testing

An armvl-unknown-linux-gnu device has been successfully paired / commissioned using the iOS 26.2 Apple "Home" app with a Connectivity Manager implementation using this infrastructure.

@gerickson gerickson force-pushed the user/gerickson/github-issue-42516-connectivity-callback-support-methods branch from bc53c60 to 4e48856 Compare February 10, 2026 18:58
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces new callback setters and delegation methods to improve encapsulation and reduce code duplication within the Linux ConnectivityManagerImpl. The changes are well-structured and successfully centralize callback handling. All identified issues, including a critical one regarding uninitialized member variables and several medium-severity issues related to function parameter passing conventions, remain valid and should be addressed for consistency, performance, and to prevent undefined behavior.

Comment thread src/platform/Linux/ConnectivityManagerImpl.h Outdated
Comment thread src/platform/Linux/ConnectivityManagerImpl.cpp Outdated
Comment thread src/platform/Linux/ConnectivityManagerImpl.cpp Outdated
Comment thread src/platform/Linux/ConnectivityManagerImpl.cpp Outdated
@gerickson gerickson force-pushed the user/gerickson/github-issue-42516-connectivity-callback-support-methods branch 5 times, most recently from 923c954 to 6e18096 Compare February 10, 2026 22:41
@gerickson gerickson changed the title Add and Leverage Linux Connectivity Callback Setter and Action Delegation Methods Add and Leverage Linux Connectivity Callback Introspection, Mutation, and Action Delegation Methods Feb 11, 2026
@gerickson
Copy link
Copy Markdown
Contributor Author

@enkiusz or @andy31415, any thoughts on this?

@gerickson
Copy link
Copy Markdown
Contributor Author

@andy31415, any thoughts on this?

@gerickson
Copy link
Copy Markdown
Contributor Author

@tersal, @arkq, or @andy31415, any thoughts on this?

Comment thread src/platform/Linux/ConnectivityManagerImpl.cpp Outdated
Comment thread src/platform/Linux/ConnectivityManagerImpl.cpp Outdated
Comment thread src/platform/Linux/ConnectivityManagerImpl.cpp Outdated
Comment thread src/platform/Linux/ConnectivityManagerImpl.h Outdated
Comment thread src/platform/Linux/ConnectivityManagerImpl.h Outdated
Comment thread src/platform/Linux/ConnectivityManagerImpl.cpp Outdated
Comment thread src/platform/Linux/ConnectivityManagerImpl.cpp Outdated
@gerickson gerickson force-pushed the user/gerickson/github-issue-42516-connectivity-callback-support-methods branch 4 times, most recently from 0ea7b3e to 78c8e81 Compare February 24, 2026 20:48
@gerickson gerickson requested a review from andy31415 February 24, 2026 20:49
@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 24, 2026

Codecov Report

❌ Patch coverage is 22.50000% with 31 lines in your changes missing coverage. Please review.
✅ Project coverage is 54.05%. Comparing base (be49d55) to head (ebc639e).
⚠️ Report is 25 commits behind head on master.

Files with missing lines Patch % Lines
...vityManagerImpl_NetworkManagementWpaSupplicant.cpp 0.00% 16 Missing ⚠️
src/platform/Linux/ConnectivityManagerImpl.cpp 37.50% 15 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master   #43062   +/-   ##
=======================================
  Coverage   54.04%   54.05%           
=======================================
  Files        1548     1548           
  Lines      106696   106704    +8     
  Branches    13314    13313    -1     
=======================================
+ Hits        57669    57677    +8     
  Misses      49027    49027           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@gerickson
Copy link
Copy Markdown
Contributor Author

@andy31415, I had one open question for you; that aside, I think this incorporates all of your requested feedback.

@gerickson gerickson force-pushed the user/gerickson/github-issue-42516-connectivity-callback-support-methods branch from 78c8e81 to 854e504 Compare March 5, 2026 19:53
@gerickson
Copy link
Copy Markdown
Contributor Author

@andy31415, all outstanding comments resolved. Should be good to go for your final review.

Comment thread src/platform/Linux/ConnectivityManagerImpl.h
@gerickson
Copy link
Copy Markdown
Contributor Author

@enkiusz, @arkq, or @tersal, would any of you be able to lend another review?

Comment thread src/platform/Linux/ConnectivityManagerImpl.cpp
Comment thread src/platform/Linux/ConnectivityManagerImpl.cpp
Comment thread src/platform/Linux/ConnectivityManagerImpl.cpp Outdated
@enkiusz
Copy link
Copy Markdown
Contributor

enkiusz commented Mar 6, 2026

@enkiusz, @arkq, or @tersal, would any of you be able to lend another review?

I added my comments but forgot to click 'submit review', sorry for that.

@gerickson gerickson force-pushed the user/gerickson/github-issue-42516-connectivity-callback-support-methods branch from 854e504 to 60eac26 Compare March 6, 2026 16:59
@gerickson gerickson requested a review from enkiusz March 6, 2026 17:00
@gerickson gerickson force-pushed the user/gerickson/github-issue-42516-connectivity-callback-support-methods branch from 60eac26 to 2545f54 Compare March 6, 2026 19:44
@mergify mergify Bot added the conflict label Mar 10, 2026
@gerickson gerickson force-pushed the user/gerickson/github-issue-42516-connectivity-callback-support-methods branch from 2545f54 to 5c827cd Compare March 10, 2026 13:58
@mergify mergify Bot removed the conflict label Mar 10, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 10, 2026

PR #43062: Size comparison from ba97f02 to 5c827cd

Full report (30 builds for bl602, bl616, bl702, bl702l, cc13x4_26x4, cc32xx, nrfconnect, nxp, psoc6, qpg, realtek, stm32, telink)
platform target config section ba97f02 5c827cd change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1089430 1089430 0 0.0
RAM 144762 144762 0 0.0
bl616 lighting-app bl616+thread FLASH 1100108 1100108 0 0.0
RAM 104184 104184 0 0.0
bl616+wifi+shell FLASH 1586972 1586972 0 0.0
RAM 98080 98080 0 0.0
bl702 lighting-app bl702+eth FLASH 1052790 1052790 0 0.0
RAM 108357 108357 0 0.0
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 890814 890814 0 0.0
RAM 105748 105748 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 779236 779236 0 0.0
RAM 103324 103324 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 786576 786576 0 0.0
RAM 108508 108508 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 732812 732812 0 0.0
RAM 97316 97316 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 716248 716248 0 0.0
RAM 97476 97476 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 558130 558130 0 0.0
RAM 204504 204504 0 0.0
lock CC3235SF_LAUNCHXL FLASH 591262 591262 0 0.0
RAM 204744 204744 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 857656 857656 0 0.0
RAM 161999 161999 0 0.0
nxp contact mcxw71+release FLASH 735904 735904 0 0.0
RAM 66936 66936 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1708852 1708852 0 0.0
RAM 213940 213940 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1607524 1607524 0 0.0
RAM 210812 210812 0 0.0
light cy8ckit_062s2_43012 FLASH 1470668 1470668 0 0.0
RAM 196988 196988 0 0.0
lock cy8ckit_062s2_43012 FLASH 1497364 1497364 0 0.0
RAM 224732 224732 0 0.0
qpg lighting-app qpg6200+debug FLASH 840748 840748 0 0.0
RAM 127780 127780 0 0.0
lock-app qpg6200+debug FLASH 779408 779408 0 0.0
RAM 118728 118728 0 0.0
realtek light-switch-app rtl8777g FLASH 720776 720776 0 0.0
RAM 113448 113448 0 0.0
lighting-app rtl8777g FLASH 767984 767984 0 0.0
RAM 114688 114688 0 0.0
stm32 light STM32WB5MM-DK FLASH 478904 478904 0 0.0
RAM 141324 141324 0 0.0
telink bridge-app tl7218x FLASH 728880 728880 0 0.0
RAM 95768 95768 0 0.0
light-app-ota-compress-lzma-shell-factory-data tl3218x FLASH 853046 853046 0 0.0
RAM 44184 44184 0 0.0
tl7218x FLASH 844446 844446 0 0.0
RAM 99572 99572 0 0.0
light-switch-app-ota-compress-lzma-factory-data tl7218x_retention FLASH 725726 725726 0 0.0
RAM 55740 55740 0 0.0
light-switch-app-ota-compress-lzma-shell-factory-data tlsr9528a FLASH 788290 788290 0 0.0
RAM 74924 74924 0 0.0
light-switch-app-ota-factory-data tl3218x_retention FLASH 725726 725726 0 0.0
RAM 33228 33228 0 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 615502 615502 0 0.0
RAM 118232 118232 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 843242 843246 4 0.0
RAM 97280 97280 0 0.0

This more accurately reflects its set-scan-and-clear usage.
This more accurately reflects its set-connect-and-clear usage.
These three methods consolidate the handling and dispatch of scan,
connect, and network status change action delegation callback
invocation and, for scan and connect, post-invocation nullification.
This not only makes it easier to keep callback members private as
implementations fan out from the current, single wpa_supplicant
implementation but also reduces duplication among those
implementations for common callback-related operations.
Previously, the status change callback was initialized with a default
initializer and the connect and scan callbacks were initialized in the
explicit initializer.

With this change, all three are now initialized in the explicit
initializer.
@gerickson gerickson force-pushed the user/gerickson/github-issue-42516-connectivity-callback-support-methods branch from 5c827cd to ebc639e Compare March 10, 2026 16:08
@gerickson
Copy link
Copy Markdown
Contributor Author

@enkiusz, any additional thoughts on this one?

@mergify mergify Bot merged commit fa956ce into project-chip:master Mar 13, 2026
78 checks passed
@gerickson
Copy link
Copy Markdown
Contributor Author

Thanks @andy31415 and @enkiusz!

@gerickson gerickson deleted the user/gerickson/github-issue-42516-connectivity-callback-support-methods branch March 13, 2026 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants