2021-02-20 17:48:12 +00:00
|
|
|
from owrx.source.soapy import SoapyConnectorSource, SoapyConnectorDeviceDescription
|
|
|
|
from owrx.form import Input
|
|
|
|
from owrx.form.device import BiasTeeInput
|
|
|
|
from typing import List
|
2019-12-21 19:58:28 +00:00
|
|
|
|
|
|
|
|
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):
|
2021-02-20 17:48:12 +00:00
|
|
|
def getInputs(self) -> List[Input]:
|
2021-02-21 23:35:47 +00:00
|
|
|
return super().getInputs() + [BiasTeeInput()]
|
|
|
|
|
|
|
|
def getOptionalKeys(self):
|
|
|
|
return super().getOptionalKeys() + ["bias_tee"]
|
|
|
|
|
|
|
|
# TODO: find actual gain stages for hackrf
|
|
|
|
# def getGainStages(self):
|
|
|
|
# return None
|