Skip to content

Conversation

@abc8747
Copy link
Contributor

@abc8747 abc8747 commented Nov 3, 2025

Previously, opening a device by index was unreliable.

  • added a new DeviceDescriptors struct that provides an iterator over only supported RTL-SDR devices, ensuring that DeviceId::Index(n) reliably refers to the nth known RTL-SDR
  • a new Sensor API is introduced to provide an interface for querying device state like tuner type and gain
  • the rtl_test example has also been updated to use the new enumeration logic, supporting device selection by either filtered index or serial number

Tested with blog V4:

$ cargo run --example rtl_test
Found 1 device(s):
  0:  RTLSDRBlog, Blog V4, SN: 00000001

Using device 0: RTLSDRBlog, Blog V4, SN: 00000001
Found r828d tuner
Supported gain values (29): 0.0 0.9 1.4 2.7 3.7 7.7 8.7 12.5 14.4 15.7 16.6 19.7 20.7 22.9 25.4 28.0 29.7 32.8 33.8 36.4 37.2 38.6 40.2 42.1 43.4 43.9 44.5 48.0 49.6
Sampling at 2048000 S/s.
Reading samples in sync mode...

Addresses xoolive/rs1090#264 (comment), xoolive/rs1090#294 (impl Send for Tuner and Error will be in a separate PR)
cc: @xoolive

abc8747 and others added 2 commits November 3, 2025 11:11
Previously, opening a device by index was unreliable.

- added a new `DeviceDescriptors` struct that provides an iterator over
  *only* supported RTL-SDR devices, ensuring that `DeviceId::Index(n)` reliably
  refers to the nth *known* RTL-SDR
- a new `Sensor` API is introduced to provide an interface for querying device
  state like tuner type and gain
- the `rtl_test` example has also been updated to use the new enumeration logic,
  supporting device selection by either filtered index or serial number
@xoolive
Copy link

xoolive commented Nov 3, 2025

I just added some logic in the rtl_test example program to use a -f flag and select devices based on manufacturer/product/serial.
rust-soapysdr offers something similar and I find it very convenient as far as I am concerned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants