-
Notifications
You must be signed in to change notification settings - Fork 320
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
Support specifying VID/PID for scanning + steamline scanning in tools #791
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add a backup function for Windows machines. Signed-off-by: Robin Getz <[email protected]>
so wrap it to make sure we can find it. Signed-off-by: Robin Getz <[email protected]>
Instead of going through the list of enabled backends and checking for each one whether or not we were asked to scan from it, we now go through the user-supplied backends list, find the corresponding backend, and call its scan function. This change will make it possible to support scanning from the same backend multiple times, for instance with different USB devices. Signed-off-by: Paul Cercueil <[email protected]>
Libiio 1.x (in the dev branch) uses a comma instead of a colon as the backends separator in the scan list string. This makes it possible to use the colon as the VID/PID separator in the USB backend parameters. Update the code and documentation to specify that commas should be used, while still allowing colons as separators to be backwards-compatible. Signed-off-by: Paul Cercueil <[email protected]>
When we do a USB scan, we open each device looking for a string "IIO", and if it is not, then we close the device. The archirecture of libusb is that when we are doing this, other applications are locked out from using that device. This is known to cause some user problems on other devices (not IIO) - most notibly HackRF and USRP. This change adds the ability to restricting scans to certain vendors, or specific product IDs - which is what most purpose build software is looking for. (GNU Radio doesn't want to open every device, only the ones it knows about). This should allow us to play nicer with others. Examples: usb,local local,usb=0456:b673,usb=0456:b672 usb=0456:* VENDOR ID and PRODUCT ID are hexadecimal numbers (no prefix needed), "*" (match any). By default (no vid:pid provided) all devices are opened and checked (which is the previous behavour). Signed-off-by: Robin Getz <[email protected]> Signed-off-by: Paul Cercueil <[email protected]>
With the updated scan options, it's possible to scan usb, or ip multiple times, and get duplicates in the list. This sorts the list, and removes duplicates if found, so users get a minimal list. Signed-off-by: Robin Getz <[email protected]> Signed-off-by: Paul Cercueil <[email protected]>
Instead of scanning all USB devices everytime a new device is plugged, which might disrupt the functionality of the unrelated devices being scanned, only scan for the USB device we are interested in, since we know its VID/PID. Signed-off-by: Paul Cercueil <[email protected]>
this ensures you can do a "-S" on any utility, and it scans the same way on all different utilities. Signed-off-by: Robin Getz <[email protected]> Signed-off-by: Paul Cercueil <[email protected]>
If you are given a context, but no device/channel, walk through things and print out examples which you might be able to use, as a hint for people. (so I can stop telling them to do it with iio_attr manually). Signed-off-by: Robin Getz <[email protected]>
pcercuei
force-pushed
the
pcercuei/usb-scan-work
branch
from
February 17, 2022 10:21
aa35512
to
888dd29
Compare
rgetz
approved these changes
Feb 17, 2022
@rgetz this last commit breaks iio_readdev / iio_writedev. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
A rewrite of #764.
This PR does a few things.
usb=0456:b672
--scan
(aka-S
) option and updated the documentation and man pagesThe possibility to specify a USB device's VID/PID on the backends scan string makes it possible to only target a specific device, instead of probing all devices on the USB bus. This is useful for applications built around particular pieces of hardware. It also avoids disrupting the functionality of other USB devices on the bus.