openwebrx-clone/owrx/source/hackrf.py

37 lines
1.1 KiB
Python
Raw Normal View History

from owrx.source.soapy import SoapyConnectorSource, SoapyConnectorDeviceDescription
2021-04-29 13:17:21 +00:00
from owrx.form.input import Input
from owrx.form.input.device import BiasTeeInput
from typing import List
2020-05-30 20:58:31 +00:00
class HackrfSource(SoapyConnectorSource):
2020-05-30 21:03:43 +00:00
def getSoapySettingsMappings(self):
mappings = super().getSoapySettingsMappings()
mappings.update({"bias_tee": "bias_tx"})
return mappings
2020-05-30 20:58:31 +00:00
def getDriver(self):
2021-01-20 16:01:46 +00:00
return "hackrf"
2021-02-20 17:09:24 +00:00
class HackrfDeviceDescription(SoapyConnectorDeviceDescription):
def getName(self):
return "HackRF"
def supportsPpm(self):
# not implemented by the SoapySDR module.
# see discussion here: https://groups.io/g/openwebrx/topic/78339109
return False
def getInputs(self) -> List[Input]:
return super().getInputs() + [BiasTeeInput()]
def getDeviceOptionalKeys(self):
return super().getDeviceOptionalKeys() + ["bias_tee"]
2021-02-23 17:32:23 +00:00
def getProfileOptionalKeys(self):
return super().getProfileOptionalKeys() + ["bias_tee"]
2021-02-23 16:40:06 +00:00
def getGainStages(self):
return ["LNA", "AMP", "VGA"]