-
Notifications
You must be signed in to change notification settings - Fork 8
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
Rust-native HackRf Support #10
Conversation
I am also working on a bladerf driver. This one is complicated enough that rewriting the c code in rust with nusb is impractical, so I plan on calling into What are the blocking / threading assumptions of For the blade, this is a bit more complicated since |
Thanks for the PR. That's absolutely awesome. I'll also work with Android in the next weeks and look forward to trying this on Android. Regarding the Also, in order to make a new seify release, (To release the crate, you'd also have to add a version to the Regarding the API, at the moment it is regarded as blocking. In FutureSDR, I mark the seify blocks as blocking, which makes sure that they are spawned in a separate thread. In the long run seify should have an additional async API, but until this was not really necessary. So what you were doing now, sounds reasonable to me. I have some more technical comments that I'll inline. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get some errors, when I try to run the examples. When I run the rx
example that is part of the hackrf crate, I get:
**basti@thrang git:(hackrf*):~/src/seify/crates/hackrf-one-rs >> cargo run --example rx
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.02s
Running `/home/basti/.cargo/target/debug/examples/rx`
Board ID: Ok(2)
Version: Ok("2023.01.1")
Device version: UsbVersion(1, 0, 7)
Error: Failed to receive on hackrf
Caused by:
0: transfer
1: endpoint STALL condition**
When I try to run it with the seify example, I get:
basti@thrang git:(hackrf*):~/src/seify >> cargo run --example probe --features=hackrfone
Compiling seify v0.12.0 (/home/basti/src/seify)
error[E0433]: failed to resolve: use of undeclared crate or module `info`
--> src/impls/hackrfone.rs:63:17
|
63 | ... info::warn!("HackRfOne::open received invalid args: bus_number: {bus_number:?}, ...
| ^^^^ use of undeclared crate or module `info`
Cargo.toml
Outdated
@@ -24,6 +25,7 @@ futures = "0.3" | |||
log = "0.4" | |||
nom = "7.1" | |||
num-complex = "0.4" | |||
nusb = { git = "https://github.com/kevinmehall/nusb.git", optional = true } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally, this should not become a dependency of the main crate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed
Cargo.toml
Outdated
@@ -32,6 +34,7 @@ thiserror = "1.0" | |||
[target.'cfg(not(target_arch = "wasm32"))'.dependencies] | |||
once_cell = "1.19" | |||
seify-rtlsdr = { path = "crates/rtl-sdr-rs", version = "0.0.3", optional = true } | |||
seify-hackrfone = { path = "crates/hackrf-one-rs", optional = true } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To publish to crates.io, this will need a version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good, waiting on a new version from nusb
: kevinmehall/nusb#84, then will publish and update here
Splitting it into a separate github repo makes sense to me. Its now up at: https://github.com/MerchGuardian/seify-hackrfone, and I added a git submodule here. I fixed the examples. I had to fix two funny issues:
I can now run both |
Works for me too. Thank you! I'll merge and just revert the default features to keep soapy as the default. |
I just tried to make a new Seify release, but that requires that your crate is published. Could you please do a |
Just published |
Made PR to bump here: #11. This also removes the |
Adds support for HackRF via a rust native driver powered by nusb.
Closes #9