Skip to content

Commit

Permalink
Claim USB interface before doing bulk reads
Browse files Browse the repository at this point in the history
  • Loading branch information
nitroxis authored and newAM committed Jul 6, 2021
1 parent 7c73d4b commit ee4f808
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,7 @@ impl<MODE> HackRfOne<MODE> {
/// ```
pub fn into_rx_mode(mut self) -> Result<HackRfOne<RxMode>, Error> {
self.set_transceiver_mode(TranscieverMode::Receive)?;
self.dh.claim_interface(0)?;
Ok(HackRfOne {
dh: self.dh,
desc: self.desc,
Expand Down Expand Up @@ -627,6 +628,7 @@ impl HackRfOne<RxMode> {
/// # Ok::<(), hackrfone::Error>(())
/// ```
pub fn stop_rx(mut self) -> Result<HackRfOne<UnknownMode>, Error> {
self.dh.release_interface(0)?;
self.set_transceiver_mode(TranscieverMode::Off)?;
Ok(HackRfOne {
dh: self.dh,
Expand Down

0 comments on commit ee4f808

Please sign in to comment.