2019-12-27 23:26:45 +00:00
|
|
|
from .direct import DirectSource
|
|
|
|
from owrx.command import Flag, Option
|
2019-12-21 19:58:28 +00:00
|
|
|
|
|
|
|
|
2019-12-27 23:26:45 +00:00
|
|
|
class HackrfSource(DirectSource):
|
|
|
|
def __init__(self, id, props, port):
|
|
|
|
super().__init__(id, props, port)
|
2019-12-28 00:24:07 +00:00
|
|
|
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-")
|
2019-12-27 23:26:45 +00:00
|
|
|
|
|
|
|
def getEventNames(self):
|
|
|
|
return super().getEventNames() + [
|
|
|
|
"lna_gain",
|
|
|
|
"rf_amp",
|
|
|
|
]
|
2019-12-21 19:58:28 +00:00
|
|
|
|
|
|
|
def getFormatConversion(self):
|
2019-12-28 15:44:45 +00:00
|
|
|
return ["csdr convert_s8_f"]
|