2021-02-20 18:48:12 +01:00
|
|
|
from owrx.source.soapy import SoapyConnectorSource, SoapyConnectorDeviceDescription
|
2021-04-29 15:17:21 +02:00
|
|
|
from owrx.form.input import Input
|
|
|
|
from owrx.form.input.device import BiasTeeInput
|
2021-02-20 18:48:12 +01:00
|
|
|
from typing import List
|
2019-12-21 20:58:28 +01:00
|
|
|
|
|
|
|
|
2020-05-30 22:58:31 +02:00
|
|
|
class HackrfSource(SoapyConnectorSource):
|
2020-05-30 23:03:43 +02:00
|
|
|
def getSoapySettingsMappings(self):
|
|
|
|
mappings = super().getSoapySettingsMappings()
|
|
|
|
mappings.update({"bias_tee": "bias_tx"})
|
|
|
|
return mappings
|
|
|
|
|
2020-05-30 22:58:31 +02:00
|
|
|
def getDriver(self):
|
2021-01-20 17:01:46 +01:00
|
|
|
return "hackrf"
|
2021-02-20 18:09:24 +01:00
|
|
|
|
|
|
|
|
|
|
|
class HackrfDeviceDescription(SoapyConnectorDeviceDescription):
|
2021-04-17 17:42:08 +02:00
|
|
|
def getName(self):
|
|
|
|
return "HackRF"
|
|
|
|
|
2021-02-20 18:48:12 +01:00
|
|
|
def getInputs(self) -> List[Input]:
|
2021-02-22 00:35:47 +01:00
|
|
|
return super().getInputs() + [BiasTeeInput()]
|
|
|
|
|
2021-03-24 23:17:50 +01:00
|
|
|
def getDeviceOptionalKeys(self):
|
|
|
|
return super().getDeviceOptionalKeys() + ["bias_tee"]
|
2021-02-22 00:35:47 +01:00
|
|
|
|
2021-02-23 18:32:23 +01:00
|
|
|
def getProfileOptionalKeys(self):
|
|
|
|
return super().getProfileOptionalKeys() + ["bias_tee"]
|
|
|
|
|
2021-02-23 17:40:06 +01:00
|
|
|
def getGainStages(self):
|
|
|
|
return ["LNA", "AMP", "VGA"]
|