2019-12-27 23:26:45 +00:00
|
|
|
from .direct import DirectSource
|
2020-04-10 18:05:06 +00:00
|
|
|
from owrx.command import Option
|
2020-04-19 21:36:35 +00:00
|
|
|
import time
|
2019-12-21 19:58:28 +00:00
|
|
|
|
|
|
|
|
2019-12-27 23:26:45 +00:00
|
|
|
class HackrfSource(DirectSource):
|
2019-12-31 18:14:05 +00:00
|
|
|
def getCommandMapper(self):
|
|
|
|
return super().getCommandMapper().setBase("hackrf_transfer").setMappings(
|
2019-12-28 00:24:07 +00:00
|
|
|
{
|
|
|
|
"samp_rate": Option("-s"),
|
|
|
|
"tuner_freq": Option("-f"),
|
|
|
|
"rf_gain": Option("-g"),
|
|
|
|
"lna_gain": Option("-l"),
|
|
|
|
"rf_amp": Option("-a"),
|
2020-04-15 19:22:06 +00:00
|
|
|
"ppm": Option("-C"),
|
2019-12-28 00:24:07 +00:00
|
|
|
}
|
|
|
|
).setStatic("-r-")
|
2019-12-27 23:26:45 +00:00
|
|
|
|
2019-12-21 19:58:28 +00:00
|
|
|
def getFormatConversion(self):
|
2019-12-28 15:44:45 +00:00
|
|
|
return ["csdr convert_s8_f"]
|
2020-04-19 21:36:35 +00:00
|
|
|
|
|
|
|
def sleepOnRestart(self):
|
|
|
|
time.sleep(1)
|