fix(Comms): check link connection state in _isSerialPortConnected - #15033
fix(Comms): check link connection state in _isSerialPortConnected#15033ginolee218 wants to merge 1 commit into
Conversation
On Android, _isSerialPortConnected() returned true as long as a SerialLink instance existed in _rgLinks, even when disconnected. This prevented availablePorts() from probing new or reconnected serial devices after a disconnect or reboot. Check link->isConnected() so it only reports true when actively connected.
|
Thanks for your first pull request! 🎉 A maintainer will review this soon. Please ensure:
We appreciate your contribution to QGroundControl! |
Codecov Report❌ Patch coverage is
❌ Your patch check has failed because the patch coverage (0.00%) is below the target coverage (30.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## master #15033 +/- ##
==========================================
+ Coverage 25.47% 34.49% +9.02%
==========================================
Files 769 945 +176
Lines 65912 85627 +19715
Branches 30495 39467 +8972
==========================================
+ Hits 16788 29537 +12749
+ Misses 37285 36459 -826
- Partials 11839 19631 +7792
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 662 files with indirect coverage changes Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
Build ResultsPlatform Status
All builds passed. Pre-commit
Pre-commit hooks: 2 passed, 76 failed, 7 skipped. Test Resultslinux-coverage-integration: 52 passed, 0 skipped Code CoverageCoverage: 70.6% No baseline available for comparison Artifact Sizes
Updated: 2026-09-03 10:17:38 UTC • Commit: c6460f3 • Triggered by: Linux |
Description
On Android,
LinkManager::_isSerialPortConnected()returnedtrueas long as anySerialLinkinstance was found in_rgLinks, without checking whether the link wasactually connected.
When a connected USB serial port disconnected, rebooted, or lost connection, the
disconnected SerialLink instance remained in _rgLinks. As a result,
_isSerialPortConnected() incorrectly continued to return true, blocking
QGCSerialPortInfo::availablePorts() from running. This caused auto-reconnect on Android
to stall after disconnection until the app was restarted.
This PR adds if (link->isConnected()) inside _isSerialPortConnected(), ensuring it only
reports true when a serial link is actively connected, allowing port scanning and auto-
reconnection to resume after a disconnect.
Type of Change
Testing
Platforms Tested
Flight Stacks Tested
Screenshots
Checklist
Related Issues
By submitting this pull request, I confirm that my contribution is made under the terms of the project's dual license (Apache 2.0 and GPL v3).