Skip to content

Conversation

@DonLakeFlyer
Copy link
Collaborator

  • Fix for Deal with multiple composite ports on same device #12893
  • These changes should bring the basically code back to how 4.4 worked
  • The secondary ports from a composite device are not made available to autoconnect
  • The list of ports available to manual connections is the full un-filtered list. This differs from 4.4 which filtered the manual connect list as well.
  • Fixed SerialLink to not pop PermissionError errors on autoconnect links

So far I've tested Mac and Windows for correct behavior on:

  • Eating PermissionError's
  • USB cable pull and reconnect. Note: On Windows, same as before, usb cable pull doesn't automatically close link,. You need to disconnect manually.
  • Autoconnect to a composite device like Cube Orange running Ardupilot works

This can still cause failures on autoconnect to composite devices line Cube Orange. But it is basically the same failures that occurred with 4.4. Linux seems to be the OS which causes the most grief. In those cases you will need to turn off Autoconnect and manual connect to the right port.

@DonLakeFlyer DonLakeFlyer requested review from HTRamsey and Copilot May 25, 2025 17:48
@DonLakeFlyer
Copy link
Collaborator Author

@HTRamsey Can you give Linux and Android a try with this?

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 restores 4.4–style autoconnect behavior by filtering out secondary composite USB ports and suppressing permission errors during autoconnect.

  • Adjust SerialLink to skip emitting permission errors when auto-connect is enabled
  • Add _filterCompositePorts in LinkManager to drop non-MAVLink interfaces on composite devices
  • Update LinkManager headers and invoke filtering before establishing serial autoconnect links

Reviewed Changes

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

File Description
src/Comms/SerialLink.cc Only emit errors on autoconnect when not a permission error; always disconnect port on failure
src/Comms/LinkManager.h Declared _filterCompositePorts helper
src/Comms/LinkManager.cc Implemented filtering logic for composite ports and applied it to the autoconnect port list
Comments suppressed due to low confidence (1)

src/Comms/SerialLink.cc:206

  • This unguarded call will always disconnect the port, even during autoconnect. Reintroduce a check (e.g. if (!_serialConfig->isAutoConnect())) to prevent disconnecting when auto-connect is active, matching the comment’s intent.
_onPortDisconnected();

{
typedef QPair<quint16, quint16> VidPidPair_t;

QList<QGCSerialPortInfo> list;
Copy link

Copilot AI May 25, 2025

Choose a reason for hiding this comment

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

The local variable list is declared but never used. Remove this dead code to improve clarity and avoid confusion.

Suggested change
QList<QGCSerialPortInfo> list;

Copilot uses AI. Check for mistakes.
@HTRamsey
Copy link
Collaborator

Linux is good, will try Android tonight

@DonLakeFlyer DonLakeFlyer merged commit f57c53b into master May 27, 2025
15 of 16 checks passed
@DonLakeFlyer DonLakeFlyer deleted the CompositeFilter branch May 27, 2025 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants