2021-02-20 17:09:24 +00:00
|
|
|
from owrx.source.soapy import SoapyConnectorSource, SoapyConnectorDeviceDescription
|
2021-04-29 13:17:21 +00:00
|
|
|
from owrx.form.input import Input, CheckboxInput
|
|
|
|
from owrx.form.input.device import BiasTeeInput
|
2021-02-20 17:48:12 +00:00
|
|
|
from typing import List
|
2019-12-21 19:58:28 +00:00
|
|
|
|
|
|
|
|
|
|
|
class AirspySource(SoapyConnectorSource):
|
2020-03-14 00:13:23 +00:00
|
|
|
def getSoapySettingsMappings(self):
|
|
|
|
mappings = super().getSoapySettingsMappings()
|
2020-03-21 14:18:45 +00:00
|
|
|
mappings.update(
|
|
|
|
{
|
|
|
|
"bias_tee": "biastee",
|
|
|
|
"bitpack": "bitpack",
|
|
|
|
}
|
|
|
|
)
|
2020-03-14 00:13:23 +00:00
|
|
|
return mappings
|
2019-12-27 23:33:27 +00:00
|
|
|
|
2019-12-21 19:58:28 +00:00
|
|
|
def getDriver(self):
|
|
|
|
return "airspy"
|
2021-02-20 17:09:24 +00:00
|
|
|
|
|
|
|
|
|
|
|
class AirspyDeviceDescription(SoapyConnectorDeviceDescription):
|
2021-04-17 15:42:08 +00:00
|
|
|
def getName(self):
|
|
|
|
return "Airspy R2 or Mini"
|
|
|
|
|
2022-06-09 18:25:29 +00:00
|
|
|
def supportsPpm(self):
|
|
|
|
# not supported by the device API
|
|
|
|
# frequency calibration can be done with separate tools and will be persisted on the device.
|
|
|
|
# see discussion here: https://groups.io/g/openwebrx/topic/79360293
|
|
|
|
return False
|
|
|
|
|
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(),
|
|
|
|
CheckboxInput(
|
|
|
|
"bitpack",
|
2021-02-21 23:57:02 +00:00
|
|
|
"Enable bit-packing",
|
2021-02-21 23:35:47 +00:00
|
|
|
infotext="Packs two 12-bit samples into 3 bytes."
|
|
|
|
+ " Lowers USB bandwidth consumption, increases CPU load",
|
|
|
|
),
|
|
|
|
]
|
|
|
|
|
2021-03-24 22:17:50 +00:00
|
|
|
def getDeviceOptionalKeys(self):
|
|
|
|
return super().getDeviceOptionalKeys() + ["bias_tee", "bitpack"]
|
2021-02-21 23:35:47 +00:00
|
|
|
|
2021-02-23 17:32:23 +00:00
|
|
|
def getProfileOptionalKeys(self):
|
|
|
|
return super().getProfileOptionalKeys() + ["bias_tee"]
|
|
|
|
|
2021-02-23 16:36:16 +00:00
|
|
|
def getGainStages(self):
|
|
|
|
return ["LNA", "MIX", "VGA"]
|