waverave-hackrf
This is a complete, strongly-asynchronous host crate for the HackRF,
made using the pure-rust nusb crate for USB interfacing. It reproduces all
the functionality of the original libhackrf library.
The standard entry point for this library is open_hackrf(), which will open
the first available HackRF device.
Getting started is easy: open up a HackRF peripheral, configure it as needed, and enter into transmit, receive, or RX sweep mode. Changing the operating mode also changes the struct used, i.e. it uses the typestate pattern. The different states and their corresponding structs are:
HackRf- The default, off, state.Receive- Receiving RF signals.Transmit- Transmitting RF signals.Sweep- Running a receive sweep through multiple tuning frequencies.
If a mode change error occurs, the HackRf struct is returned alongside the
error, and it can potentially be reset back to the off state by running
HackRf::turn_off.
As for what using this library looks like in practice, here's an example program that configures the system, enters receive mode, and processes samples to estimate the average received power relative to full scale:
use Result;
async