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

Improve the usbcsv example #310

Merged
merged 1 commit into from Apr 12, 2021
Merged

Conversation

Codysseus
Copy link
Contributor

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 the
ProcessWaveform 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.

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 the
ProcessWaveform 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.
@azonenberg azonenberg merged commit 5ff7cfd into ngscopeclient:master Apr 12, 2021
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.

None yet

2 participants