openwebrx-clone/owrx/source/hackrf.py
2019-12-31 15:24:11 +01:00

26 lines
717 B
Python

from .direct import DirectSource
from owrx.command import Flag, Option
class HackrfSource(DirectSource):
def __init__(self, id, props):
super().__init__(id, props)
self.getCommandMapper().setBase("hackrf_transfer").setMappings(
{
"samp_rate": Option("-s"),
"tuner_freq": Option("-f"),
"rf_gain": Option("-g"),
"lna_gain": Option("-l"),
"rf_amp": Option("-a"),
}
).setStatic("-r-")
def getEventNames(self):
return super().getEventNames() + [
"lna_gain",
"rf_amp",
]
def getFormatConversion(self):
return ["csdr convert_s8_f"]