Documentation ¶
Overview ¶
Package hackrf provides an interface to the HackRF SDR hardware.
This package wraps libhackrf using cgo.
Index ¶
- Variables
- func ComputeBasebandFilterBW(bandwidthHz int) int
- func ComputeBasebandFilterBWRoundDownLT(bandwidthHz int) int
- func Exit() error
- func Init() error
- func LibraryRelease() string
- func LibraryVersion() string
- type Callback
- type Device
- func (d *Device) Close() error
- func (d *Device) SetAmpEnable(value bool) error
- func (d *Device) SetAntennaEnable(enabled bool) error
- func (d *Device) SetBasebandFilterBandwidth(hz int) error
- func (d *Device) SetFreq(freqHz uint64) error
- func (d *Device) SetLNAGain(value int) error
- func (d *Device) SetSampleRate(freqHz float64) error
- func (d *Device) SetSampleRateManual(freqHz, divider int) error
- func (d *Device) SetTXVGAGain(value int) error
- func (d *Device) SetVGAGain(value int) error
- func (d *Device) StartRX(cb Callback) error
- func (d *Device) StartTX(cb Callback) error
- func (d *Device) StopRX() error
- func (d *Device) StopTX() error
- func (d *Device) Version() (string, error)
- type DeviceInfo
- type ErrUnknown
- type USBBoardID
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidParam = errors.New("hackrf: invalid param") ErrNotFound = errors.New("hackrf: not found") ErrBusy = errors.New("hackrf: busy") ErrNoMem = errors.New("hackrf: no mem") ErrLibUSB = errors.New("hackrf: libusb error") ErrThread = errors.New("hackrf: thread error") ErrStreamingThreadErr = errors.New("hackrf: streaming thread error") ErrStreamingStopped = errors.New("hackrf: streaming stopped") ErrStreamingExitCalled = errors.New("hackrf: streaming exit called") ErrOther = errors.New("hackrf: other error") )
Functions ¶
func ComputeBasebandFilterBW ¶
ComputeBasebandFilterBWRoundDownLT computes the best default value depending on sample rate (auto filter)
func ComputeBasebandFilterBWRoundDownLT ¶
ComputeBasebandFilterBWRoundDownLT computse the nearest freq for bw filter (manual filter)
func LibraryRelease ¶
func LibraryRelease() string
func LibraryVersion ¶
func LibraryVersion() string
Types ¶
type Device ¶
type Device struct {
// contains filtered or unexported fields
}
func (*Device) SetAmpEnable ¶
SetAmpEnable enables or disables the external RX/TX RF amplifier.
func (*Device) SetAntennaEnable ¶
SetAntennaEnable enables ot disables antenna port power
func (*Device) SetBasebandFilterBandwidth ¶
SetBasebandFilterBandwidth sets the baseband bandwidth. Possible values are 1.75/2.5/3.5/5/5.5/6/7/8/9/10/12/14/15/20/24/28MHz.
func (*Device) SetLNAGain ¶
SetLNAGain sets the gain for the RX low-noise amplifier (IF). Range 0-40 step 8db
func (*Device) SetSampleRate ¶
SetSampleRate sets the sample rate in hz. Preferred rates are 8, 10, 12.5, 16, 20MHz due to less jitter.
func (*Device) SetSampleRateManual ¶
SetSampleRateManual sets the sample rate in hz. Preferred rates are 8, 10, 12.5, 16, 20MHz due to less jitter.
func (*Device) SetTXVGAGain ¶
SetTXVGAGain sets the gain for the TX variable gain amplifier (IF). Range 0-47 step 1db
func (*Device) SetVGAGain ¶
SetVGAGain sets the gain for the RX variable gain amplifier (baseband). Range 0-62 step 2db
type DeviceInfo ¶
type DeviceInfo struct { SerialNumber string USBBoardID USBBoardID USBDeviceIndex int }
func DeviceList ¶
func DeviceList() ([]*DeviceInfo, error)
type USBBoardID ¶
type USBBoardID uint16
const ( USBBoardIDJawbreaker USBBoardID = 0x604B USBBoardIDHackRFOne USBBoardID = 0x6089 USBBoardIDRad1o USBBoardID = 0xCC15 USBBoardIDInvalid USBBoardID = 0xFFFF )
func (USBBoardID) String ¶
func (u USBBoardID) String() string