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

Report whether other devices are sharing the USB bus #1484

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

martinling
Copy link
Member

Adds a check in hackrf_info for whether the device is on a dedicated bus.

@martinling martinling force-pushed the warn-bus-sharing branch 2 times, most recently from 4d6c946 to e27b459 Compare September 26, 2024 10:49
@mossmann
Copy link
Member

mossmann commented Oct 2, 2024

Is there a reason hackrf_device_list_bus_sharing() must be in libhackrf, or could it be in hackrf_info?

@martinling
Copy link
Member Author

I started off with all the code in hackrf_info - you can see that version in this commit.

I changed it for two reasons:

  1. Because the code needs to call libusb_get_bus_number and libusb_get_parent, it becomes necessary for hackrf_info.c to include libusb.h, and also to build the binary with the necessary linker flags to link it to libusb directly rather than just transitively via libhackrf. That would have required some changes in the build system, and I suspected that it might also cause some issues for distros.

  2. I figured this might be useful information for GUI tools as well, so having a library function that did the necessary iterating and counting seemed like a nice idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement potential new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants