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 program was originally created by azonenberg to assist in
decoding USB snippets in a headless state. The main intent of this
program is to export only packets sent from the client device
to the host computer. It is a bit messy, but I tried to make
it clear how the logic works.
The output format is as follows:
[starting line in csv] [ending line in csv] [DATA 1/0] [hex bits] | [SETUP request code]
This is supposed to make it easier to extract those client packets
from the CSV. I briefly considered using CPython to transform it
into a format that can easily be used in feature extraction libraries,
but that is more work than is necessary.
This is not a perfect example, as I only really capture the data
packets and the NAK packets. There are others in the USB spec,
so feel free to implement them.
Another thing to note is that there is a
step
variable in theProcessWaveform function that represents the number of femtoseconds
between lines in the csv. This was done because my logic analyser
does not sample at that high of a rate, and I wanted to translate
from femtoseconds that the decoder used back into a format that
fit my original CSV. So be warned that you will need to change this!
Big thank you to azonenberg for helping out with the original example.