Code Monkey home page Code Monkey logo

Comments (3)

newAM avatar newAM commented on May 23, 2024 1

Hopefully this is fixed by #12 (included in v0.2.1), going to close this issue for now, feel free to re-open if it occurs again.

from hackrfone.

newAM avatar newAM commented on May 23, 2024

I have onky used Linux to test this out. Unfortunately I do not have any Mac platforms available so I cannot test it out with that :/

If the original libhackrf works then this should in theory also work because rusb is just a wrapper for libusb which is what libhackrf is using.

If I recall correctly the device version is reported in a header during USB negotiation, which may explain why the version works, but the RX endpoint does not.

As for the SendError that is probably just my crappy code 😅. It works for me in the positive path, but I have done zero testing with what happens when the sample thread stops before the main thread tells it to, which is probably the issue there.

Some TODOs for me:

  • Add tested platforms in README.
  • Fix example for negative path.

from hackrfone.

newAM avatar newAM commented on May 23, 2024

Took a look at the example failure, that's my crummy code, sorry about that!

A send operation can only fail if the receiving end of a channel is disconnected, implying that the data could never be received. The error contains the data being sent as a payload so it can be recovered.

If the sample thread ran up to here:

hackrfone/examples/rx.rs

Lines 36 to 42 in 4c7edbc

let sample_thread = thread::Builder::new()
.name("sample".to_string())
.spawn(move || -> Result<(), hackrfone::Error> {
println!("Spawned sample thread");
loop {
let samples: Vec<u8> = radio.rx()?;

Then failed at the rx()? it would disconnect and later result in the SendError being unwrapped.

from hackrfone.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.