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

Display all descriptor types in device view #197

Merged
merged 21 commits into from
Oct 12, 2024

Conversation

martinling
Copy link
Member

@martinling martinling commented Oct 10, 2024

This PR extends the device view to display additional descriptor types.

  • Interface Association Descriptors are now decoded, and their interfaces grouped into a Function.
  • All descriptors are now shown, even where not understood by Packetry.
  • Arbitrary descriptors are shown attached to configurations, interfaces or endpoints, according to where they appear in the configuration data.
  • Functions and interfaces are displayed with their associated class, based on usb.ids data.

Example:
image

A subsequent PR will support saving descriptors to files for further analysis, building on the features in #196.

@miek
Copy link
Member

miek commented Oct 11, 2024

Could you rebase this? There's just a minor conflict from merging #193

These tests have proven hard to maintain, since they depend on items
in the device tree appearing at specific indexes which will break as
further descriptors are added.
Move DeviceId and DeviceVersion to struct fields, and define a new
DeviceItemContent enum which embeds descriptor data where needed.
These methods took references previously because it reduced the number
of '*' operators needed when working with DeviceItem variants by reference.

With the new DeviceItem type this is no longer an issue.
These previously differed only by their fixed indent.
These were more useful when they were fields on DeviceItem, but now they
just complicate things.
@martinling
Copy link
Member Author

Done!

@martinling
Copy link
Member Author

martinling commented Oct 11, 2024

I've just realised that one thing in the last commit might need some further thought.

I shortened the notation Interface 1 (alternate 2) to Interface 1.2, to make more space for the interface class beside it.

However, in the traffic view we use that same notation to indicate <device number>.<interface>, e.g. in this request description:

Setting alternate setting 0 for interface 25.2

So perhaps we should go with something else like Interface 1 alt 2: Communications in the device view.

Alternate settings are abbreviated to an "N alt M" format to leave more
space for the interface class text.
@martinling
Copy link
Member Author

I've gone ahead and made the change to Interface 1 alt 2 etc in the last commit.

@miek miek merged commit 6331cd3 into greatscottgadgets:main Oct 12, 2024
10 checks passed
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.

2 participants