Change from list to info

This commit is contained in:
2025-04-30 22:06:06 -04:00
parent 973054517c
commit 1d4b8338cc
2 changed files with 15 additions and 9 deletions

View File

@@ -21,9 +21,9 @@ struct ReceiverArgs {
#[arg(short = 'c', long, action)]
connect: bool,
/// List USB devices
#[arg(short = 'l', long, action)]
list: bool,
/// Display ADS-B/Mode-S receiver info
#[arg(short = 'i', long, action)]
info: bool,
/// Enable debug logging
#[arg(short = 'D', long, action)]
@@ -41,15 +41,18 @@ fn main() -> Result<()> {
env_logger::init_from_env(env_logger::Env::default().filter_or("RUST_LOG", default_filter));
let vid = 0x0BDA;
let pid = 0x2832;
// Handle connection
if args.connect {
log::info!("Connecting to device");
let mut device = RtlSdrDevice::open(0x0BDA, 0x2832)?;
let mut device = RtlSdrDevice::open(vid, pid)?;
device.read(TransferType::Bulk)
}
// List devices
else if args.list {
RtlSdrDevice::list();
// Display dongle info
else if args.info {
RtlSdrDevice::info(vid, pid);
Ok(())
}
// Handle decode mode