samples: usb: shell: Added list_dd command #105039
samples: usb: shell: Added list_dd command #105039kartben merged 1 commit intozephyrproject-rtos:mainfrom
Conversation
Yes! Yes! I need exactly the implementation of the But current implementation is: Do you have something more regarding Meanwhile, I'll go and check other class implementation PRs.... |
|
Hi @josuah, I checked the implementation of available class drivers and found out:
and both of them request the descriptor and parse the EP descriptors internally via But both of them are using the cached values of Why not help the class drivers and free them from parsing the whole config descriptor every time with just linking the Sorry if I am missing something, but it seems that we have interface number as an argument in |
I was about to suggest this. ^_^ |
57dcdf5 to
7b3b257
Compare
|
Hi @josuah, I added two common helpers to the Also I used real USB devices + ESP32S3 to get the dump and you may find it in the PR description. Thus, introduced helpers might help to simplify the logic of
PTAL when convenient. |
7b3b257 to
f18bbf0
Compare
|
Ah, no ellipsis notation… makes sense. Sorry, will update then asap. |
I am not sure... it makes sense to support ellipsis notation when wrapping vprintf-like functions. There is no other way to do it? SonarQube will be wrong in many occasions (i.e. due to macros, rules that are there to hint users to give a look), so are not blocking on PRs currently. Not bad idea to give a look though! |
|
Hi @josuah,
Sure there is. I don't mind to change it to more explicit smaller calls. PS. wait a sec, I am about to push the changes.... |
2559c63 to
54926c8
Compare
|
Hi @josuah, much better now, IMHO (but let's wait for the SonarQube).
This time it is not completely wrong. Having the *_fmt function like, can create potential risk and format-string bugs become runtime. Why take a risk if it is possible to avoid it. 🤷 PS. If you have any USB UVC device (USB camera), feel free to try it out as they have a larger configuration descriptor usually. |
54926c8 to
3dca0e2
Compare
josuah
left a comment
There was a problem hiding this comment.
Thanks for the step-by-step improvements.
It might be useful to take the class modification to another PR so that this can be presented to authors of USB host class PRs without involving discussion about the shell.
a9a8d54 to
c69b71f
Compare
c69b71f to
d6d788e
Compare
|
Hi @josuah, I simplified the PR by:
I also updated the description with new output and updated the README according to the new style. The rest things such as:
I will add later, when gain more experience with class drivers. Maybe it won't be necessary at all or I modify the helpers somehow. PTAL once again, when convenient. |
d6d788e to
f622ffa
Compare
f622ffa to
aa688ff
Compare
jfischer-no
left a comment
There was a problem hiding this comment.
Commit message needs to be fixed as well.
This is more about host support in general.
usb: host: shell: add device list_dd command
Add shell command to print all USB device descriptors.
Signed-off-by: Roman Leonov <jam_roma@yahoo.com>
aa688ff to
d96b04a
Compare
Added: - usbh shell command to dump descriptors Signed-off-by: Roman Leonov <jam_roma@yahoo.com> Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
d96b04a to
ad1468a
Compare
|
❌ The last analysis has failed. |
josuah
left a comment
There was a problem hiding this comment.
As part of the SHELL_HELP() PR, it could be great to have a description of what list_dd means, as so far the only doc is trying and see what happens, or this PR.
Thank you for this utility, will be useful!
Description
Descriptor dump usbh shell command:
usbh device list_dd <addr>to havelsusb -v -danalogue.Command allows to get dump of the descriptors in the readable format.
USB MSC Device
USB CDC Device
USB HID Device
USB UAC Device
USB UVC Device
Related
N/A