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

Change board list output sorting #1281

Merged
merged 1 commit into from
May 7, 2021
Merged

Conversation

silvanocerza
Copy link
Contributor

@silvanocerza silvanocerza commented May 7, 2021

Please check if the PR fulfills these requirements

  • The PR has no duplicates (please search among the Pull Requests
    before creating one)
  • The PR follows
    our contributing guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • UPGRADING.md has been updated with a migration guide (for breaking changes)
  • What kind of change does this PR introduce?

Enhances an existing feature.

  • What is the current behavior?

Calling board list returns detected boards attached to a port in an unsorted and non determistic way.
This might happen when multiple boards with identical VID:PID combination are found in the currently installed Platforms.
This is an example output:

{
  "address": "/dev/cu.usbmodem14201",
  "protocol": "serial",
  "protocol_label": "Serial Port (USB)",
  "boards": [
    {
      "name": "Arduboy",
      "fqbn": "arduboy-homemade:avr:arduboy",
      "vid": "0x2341",
      "pid": "0x8036"
    },
    {
      "name": "Arduboy DevKit",
      "fqbn": "arduboy-homemade:avr:arduboy-devkit",
      "vid": "0x2341",
      "pid": "0x8036"
    },
    {
      "name": "Homemade Arduboy",
      "fqbn": "arduboy-homemade:avr:arduboy-homemade",
      "vid": "0x2341",
      "pid": "0x8036"
    },
    {
      "name": "Arduino Leonardo",
      "fqbn": "arduino:avr:leonardo",
      "vid": "0x2341",
      "pid": "0x8036"
    },
  ]
}
  • What is the new behavior?

Calling board list command now returns the detected boards sorted by FQBN alphabetically, Arduino boards are always shown before all the others.

This also affects the gRPC interface.

Example output:

{
  "address": "/dev/cu.usbmodem14201",
  "protocol": "serial",
  "protocol_label": "Serial Port (USB)",
  "boards": [
    {
      "name": "Arduino Leonardo",
      "fqbn": "arduino:avr:leonardo",
      "vid": "0x2341",
      "pid": "0x8036"
    },
    {
      "name": "Arduboy",
      "fqbn": "arduboy-homemade:avr:arduboy",
      "vid": "0x2341",
      "pid": "0x8036"
    },
    {
      "name": "Arduboy DevKit",
      "fqbn": "arduboy-homemade:avr:arduboy-devkit",
      "vid": "0x2341",
      "pid": "0x8036"
    },
    {
      "name": "Homemade Arduboy",
      "fqbn": "arduboy-homemade:avr:arduboy-homemade",
      "vid": "0x2341",
      "pid": "0x8036"
    }
  ]
}

Nope.

  • Other information:

None.


See how to contribute

@silvanocerza silvanocerza requested a review from a team May 7, 2021 10:55
@silvanocerza silvanocerza self-assigned this May 7, 2021
@silvanocerza silvanocerza changed the title Change board list output sorting Change board list output sorting May 7, 2021
Copy link
Contributor

@umbynos umbynos left a comment

Choose a reason for hiding this comment

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

🦄

Calling board list command now returns the detected boards sorted by
FQBN alphabetically, Arduino boards are always shown before all the
others.
Copy link
Contributor

@umbynos umbynos left a comment

Choose a reason for hiding this comment

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

image

@silvanocerza silvanocerza merged commit 75a93c0 into master May 7, 2021
@silvanocerza silvanocerza deleted the scerza/sort-board-list branch May 7, 2021 14:16
silvanocerza added a commit that referenced this pull request May 10, 2021
Calling board list command now returns the detected boards sorted by
FQBN alphabetically, Arduino boards are always shown before all the
others.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants