2021-02-20 18:09:24 +01:00
|
|
|
from owrx.source.soapy import SoapyConnectorSource, SoapyConnectorDeviceDescription
|
2021-04-29 15:17:21 +02:00
|
|
|
from owrx.form.input import Input, CheckboxInput
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
|
class AirspySource(SoapyConnectorSource):
|
2020-03-14 01:13:23 +01:00
|
|
|
def getSoapySettingsMappings(self):
|
|
|
|
mappings = super().getSoapySettingsMappings()
|
2020-03-21 15:18:45 +01:00
|
|
|
mappings.update(
|
|
|
|
{
|
|
|
|
"bias_tee": "biastee",
|
|
|
|
"bitpack": "bitpack",
|
|
|
|
}
|
|
|
|
)
|
2020-03-14 01:13:23 +01:00
|
|
|
return mappings
|
2019-12-28 00:33:27 +01:00
|
|
|
|
2019-12-21 20:58:28 +01:00
|
|
|
def getDriver(self):
|
|
|
|
return "airspy"
|
2021-02-20 18:09:24 +01:00
|
|
|
|
|
|
|
|
|
|
|
class AirspyDeviceDescription(SoapyConnectorDeviceDescription):
|
2021-04-17 17:42:08 +02:00
|
|
|
def getName(self):
|
|
|
|
return "Airspy R2 or Mini"
|
|
|
|
|
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(),
|
|
|
|
CheckboxInput(
|
|
|
|
"bitpack",
|
2021-02-22 00:57:02 +01:00
|
|
|
"Enable bit-packing",
|
2021-02-22 00:35:47 +01:00
|
|
|
infotext="Packs two 12-bit samples into 3 bytes."
|
|
|
|
+ " Lowers USB bandwidth consumption, increases CPU load",
|
|
|
|
),
|
|
|
|
]
|
|
|
|
|
2021-03-24 23:17:50 +01:00
|
|
|
def getDeviceOptionalKeys(self):
|
|
|
|
return super().getDeviceOptionalKeys() + ["bias_tee", "bitpack"]
|
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:36:16 +01:00
|
|
|
def getGainStages(self):
|
|
|
|
return ["LNA", "MIX", "VGA"]
|