RtlSdrDriver class abstract interface

Everything a radio session needs from the native RTL-SDR core — the seam the rest of core_rtlsdr is built against, instead of every controller calling driver_rtlsdr's NativeBindings (raw FFI) directly.

NativeRtlSdrDriver is the real, Android-only implementation, a thin adapter over driver_rtlsdr. Tests — here, and in consumers such as a future widget_rtlsdr — should use FakeRtlSdrDriver from package:core_rtlsdr/testing.dart instead: FFI can't be exercised on a host without an Android device, which is exactly why driver_rtlsdr itself only unit-tests struct layout on the host and leaves everything else to on-device integration tests. Depending on this interface instead of the FFI bindings directly is what makes every controller in this package unit-testable on any host, without a dongle or an emulator.

All setters return the native status code (0 = success, matching rtlsdr_shim.h) so callers can surface failures the same way the native driver reports them.

Implementers

Properties

demodMode → DemodMode
no setter
frequencyHz → int
no setter
hashCode → int
The hash code for this object.
no setterinherited
isIqRecording → bool
no setter
isOpen → bool
Whether the native driver has an open device (set by the Kotlin side after the USB permission flow — see UsbState/UsbChannel).
no setter
isRecording → bool
no setter
isStreaming → bool
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
sampleRateHz → int
no setter

Methods

close() → int
Closes the native device. Does not release this driver object itself — see dispose.
dispose() → void
Releases native resources held by this driver instance (FFI struct buffers). Does NOT close the device (see close) — call this once, when you're done with the driver object itself (app shutdown, or swapping implementations).
getGainList() → List<int>
Gains supported by the tuner, in tenths of a dB. Needs the device already open — call once after deviceReady.
getRdsInfo() → RdsInfo
getSpectrumDb(int numBins) → List<double>
getStats() → RadioStats
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setDemodMode(DemodMode mode) → int
setFrequencyHz(int hz) → int
setGainMode({required bool auto}) → int
setGainTenthDb(int tenthDb) → int
setRdsEnabled(bool enabled) → int
setSampleRateHz(int hz) → int
setSquelchThresholdDb(double thresholdDb) → int
setStereoEnabled(bool enabled) → int
startIqRecording(String filePath) → int
startIqRecordingFd(int fd) → int
Same as startIqRecording, but writes through an already-open file descriptor instead of a path — see startRecordingFd.
startRecording(String filePath) → int
startRecordingFd(int fd) → int
Same as startRecording, but writes through an already-open file descriptor instead of a path — for destinations with no plain filesystem path available, e.g. Android's public Downloads folder via MediaStore (see core_rtlsdr's RecordingController.startRecordingToDownloads).
startStreaming() → int
stopIqRecording() → int
stopRecording() → int
stopStreaming() → int
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited