VID/PID based device type detection #370
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This builds on #369 to solve issue #165.
In PR #299 I added device type detection. It used a strategy that made use of the files present on the device to identify which firmware was most likely running on the interface chip. This was good enough to differentiate between JLink and DAPLink based firmwares, but got a little more complicated for firmwares like ST-Link. ST-Link tends to mimic DAPLink files quite closely, so this option isn't really feasible any more.
This PR switches the strategy to instead identify device types by the Vendor ID. In this case I'm not currently using the Product ID as it does not seem necessary at this point. There also is a small chance that the Product IDs may vary a bit depending on the release of the interface firmware, so I figured I'd postpone this change until we have evidence to the contrary.
Details to review (please 😄)
This also adds
stlink
to the list detectable firmwares. The STLink detection makes use of theDAPLink
update logic at the moment, meaning you will seedaplink_build
anddaplink_version
in the JSON output, even though this is using stlink. I did this on purpose because this is how the information would have showed up in earlier versions. Should I also provide this info asstlink_*
? Should I leave it how it is?FYI @jupe @theotherjimmy