Documentation ¶
Overview ¶
Package rtl contains an sdr.Sdr implementation for rtlsdr based SDRs.
Index ¶
- func DeviceCount() uint
- func DeviceIndexBySerial(serial string) (uint, error)
- func InfoByDeviceIndex(index uint) (*sdr.HardwareInfo, error)
- type Sdr
- func (r Sdr) Close() error
- func (r Sdr) GetCenterFrequency() (rf.Hz, error)
- func (r Sdr) GetGain(gainStage sdr.GainStage) (float32, error)
- func (r Sdr) GetGainStages() (sdr.GainStages, error)
- func (r Sdr) GetPPM() int
- func (r Sdr) GetSampleRate() (uint, error)
- func (r Sdr) GetSamplesPerWindow() (uint, error)
- func (r Sdr) HardwareInfo() sdr.HardwareInfo
- func (r Sdr) ResetBuffer() error
- func (r Sdr) SampleFormat() sdr.SampleFormat
- func (r Sdr) SetAutomaticGain(automatic bool) error
- func (r Sdr) SetBiasT(on bool) error
- func (r Sdr) SetBiasTGPIO(pin int, on bool) error
- func (r Sdr) SetCenterFrequency(freq rf.Hz) error
- func (r Sdr) SetGain(gainStage sdr.GainStage, gain float32) error
- func (r Sdr) SetPPM(ppm int) error
- func (r Sdr) SetSampleRate(sps uint) error
- func (r Sdr) SetTestMode(on bool) error
- func (r Sdr) StartRx() (sdr.ReadCloser, error)
- func (r Sdr) Tuner() Tuner
- type Tuner
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeviceCount ¶
func DeviceCount() uint
DeviceCount will return the number of rtlsdr devices present on the system.
func DeviceIndexBySerial ¶
DeviceIndexBySerial will get the device index that has the Serial provided.
func InfoByDeviceIndex ¶
func InfoByDeviceIndex(index uint) (*sdr.HardwareInfo, error)
InfoByDeviceIndex will return a HardwareInfo struct by a device index.
Types ¶
type Sdr ¶
type Sdr struct {
// contains filtered or unexported fields
}
Sdr is a handle to internal rtlsdr state used by the underlying C library.
func New ¶
New will create a new Sdr struct, and initialize the internal handles as required.
index corresponds to the index into the number of devices (as seen by
DeviceCount) to open.
windowSize instructs the rtlsdr library as to how many iq samples to deliver
per callback.
func (Sdr) Close ¶
Close will call the underlying rtlsdr library to close the handle that we opened when creating this object. This should always be called when finished with the sdr.
func (Sdr) GetCenterFrequency ¶
GetCenterFrequency will return the center frequency that the rtlsdr is tuned to.
func (Sdr) GetGainStages ¶
func (r Sdr) GetGainStages() (sdr.GainStages, error)
GetGainStages implements the sdr.Sdr interface.
func (Sdr) GetSampleRate ¶
GetSampleRate will get the number of samples per second.
func (Sdr) GetSamplesPerWindow ¶
GetSamplesPerWindow will return the number of samples contained in one windows-worth of iq data.
func (Sdr) HardwareInfo ¶
func (r Sdr) HardwareInfo() sdr.HardwareInfo
HardwareInfo implements the sdr.Sdr interface
func (Sdr) ResetBuffer ¶
ResetBuffer will reset the internal rtlsdr buffer(s).
func (Sdr) SampleFormat ¶
func (r Sdr) SampleFormat() sdr.SampleFormat
SampleFormat will return the IQ sample format. For the rtlsdr this is always SampleFormatU8.
func (Sdr) SetAutomaticGain ¶
SetAutomaticGain will set the tuner mode to use AGC.
func (Sdr) SetBiasTGPIO ¶
SetBiasTGPIO will enable or disable the bias tee.
func (Sdr) SetCenterFrequency ¶
SetCenterFrequency will set the center frequency that the rtlsdr will tune to.
func (Sdr) SetSampleRate ¶
SetSampleRate will set the number of samples per second. This will not change the window size.
func (Sdr) SetTestMode ¶
SetTestMode will turn on and off test mode.
Test mode will cause every byte to be the one larger than the next byte, and on overflow, return to 0. This is useful to detect cases where you're dropping packets, or to ensure that your code can fully process the data end-to-end in real-time.
type Tuner ¶
type Tuner uint8
Tuner is an enum that represents an rtlsdr Tuner chipset.
var ( // TunerUnknown is used when the underlying rtlsdr Tuner is not known // by the underlying rtlsdr library. TunerUnknown Tuner = C.RTLSDR_TUNER_UNKNOWN // TunerE4000 represents the rtlsdr E4000 tuner type. TunerE4000 Tuner = C.RTLSDR_TUNER_E4000 // TunerFC0012 represents the rtlsdr FC0012 tuner type. TunerFC0012 Tuner = C.RTLSDR_TUNER_FC0012 // TunerFC0013 represents the rtlsdr FC0013 tuner type. TunerFC0013 Tuner = C.RTLSDR_TUNER_FC0013 // TunerFC2580 represents the rtlsdr FC2580 tuner type. TunerFC2580 Tuner = C.RTLSDR_TUNER_FC2580 // TunerR820T represents the rtlsdr R820T tuner type. TunerR820T Tuner = C.RTLSDR_TUNER_R820T // TunerR828D represents the rtlsdr R828D tuner type. TunerR828D Tuner = C.RTLSDR_TUNER_R828D )
func (Tuner) GetGainStages ¶
func (tuner Tuner) GetGainStages() (sdr.GainStages, error)
GetGainStages will return the GainStages for the specific Tuner. The Sdr.GetGainStages function will implement the sdr.Sdr interface, but will call this function to get the underlying gains.
This does not make dynamic calls, since other libraries (such as rtltcp) may need the GainStage values for a Tuner without it being plugged in, preventing the use of rtlsdr_get_tuner_gains.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package e4k contains code to translate gains in dB to values to be sent to the e4k's 6-stage IF gain controls.
|
Package e4k contains code to translate gains in dB to values to be sent to the e4k's 6-stage IF gain controls. |
Package kerberos contains the KerberosSDR driver for hz.tools/sdr
|
Package kerberos contains the KerberosSDR driver for hz.tools/sdr |
internal
Package internal contains kerberos specific internal bits of API.
|
Package internal contains kerberos specific internal bits of API. |