Module: RTLSDR::FFI
- Extended by:
- FFI::Library
- Defined in:
- lib/rtlsdr/ffi.rb
Overview
Most users should use the high-level RTLSDR::Device class instead of calling these FFI functions directly.
Low-level FFI bindings to librtlsdr
The FFI module provides direct 1:1 bindings to the librtlsdr C library, exposing all native functions with their original signatures and behaviors. This module handles library loading from multiple common locations and defines all necessary data types, constants, and function prototypes.
This is the foundation layer that the high-level Device class is built upon, but can also be used directly for applications that need complete control over the C API or want to implement custom abstractions.
Features:
- Complete librtlsdr API coverage
- Automatic library discovery and loading
- Proper FFI type definitions and callbacks
- Tuner type constants and helper functions
- Memory management support for pointers
Constant Summary collapse
- RTLSDR_TUNER_UNKNOWN =
Unknown or unsupported tuner type
0- RTLSDR_TUNER_E4000 =
Elonics E4000 tuner (52 - 2200 MHz with gaps)
1- RTLSDR_TUNER_FC0012 =
Fitipower FC0012 tuner (22 - 948 MHz)
2- RTLSDR_TUNER_FC0013 =
Fitipower FC0013 tuner (22 - 1100 MHz)
3- RTLSDR_TUNER_FC2580 =
FCI FC2580 tuner (146 - 308 MHz and 438 - 924 MHz)
4- RTLSDR_TUNER_R820T =
Rafael Micro R820T tuner (24 - 1766 MHz)
5- RTLSDR_TUNER_R828D =
Rafael Micro R828D tuner (24 - 1766 MHz)
6
Class Method Summary collapse
-
.tuner_type_name(tuner_type) ⇒ String
Convert tuner type constant to human-readable name.
Class Method Details
.tuner_type_name(tuner_type) ⇒ String
Convert tuner type constant to human-readable name
160 161 162 163 164 165 166 167 168 169 170 171 |
# File 'lib/rtlsdr/ffi.rb', line 160 def self.tuner_type_name(tuner_type) case tuner_type when RTLSDR_TUNER_UNKNOWN then "Unknown" when RTLSDR_TUNER_E4000 then "Elonics E4000" when RTLSDR_TUNER_FC0012 then "Fitipower FC0012" when RTLSDR_TUNER_FC0013 then "Fitipower FC0013" when RTLSDR_TUNER_FC2580 then "FCI FC2580" when RTLSDR_TUNER_R820T then "Rafael Micro R820T" when RTLSDR_TUNER_R828D then "Rafael Micro R828D" else "Unknown (#{tuner_type})" end end |