openwebrx-clone/owrx/source/airspy.py

42 lines
1.3 KiB
Python
Raw Normal View History

2021-02-20 17:09:24 +00:00
from owrx.source.soapy import SoapyConnectorSource, SoapyConnectorDeviceDescription
2021-02-20 18:20:31 +00:00
from owrx.form import Input, CheckboxInput
from owrx.form.device import BiasTeeInput
2021-02-20 18:20:31 +00:00
from owrx.form.converter import OptionalConverter
from typing import List
class AirspySource(SoapyConnectorSource):
def getSoapySettingsMappings(self):
mappings = super().getSoapySettingsMappings()
2020-03-21 14:18:45 +00:00
mappings.update(
{
"bias_tee": "biastee",
"bitpack": "bitpack",
}
)
return mappings
2019-12-27 23:33:27 +00:00
def getDriver(self):
return "airspy"
2021-02-20 17:09:24 +00:00
class AirspyDeviceDescription(SoapyConnectorDeviceDescription):
def getInputs(self) -> List[Input]:
return super().getInputs() + [
BiasTeeInput(),
CheckboxInput(
"bitpack",
"Enable bit-packing",
infotext="Packs two 12-bit samples into 3 bytes."
+ " Lowers USB bandwidth consumption, increases CPU load",
converter=OptionalConverter(defaultFormValue=False),
),
]
def getOptionalKeys(self):
return super().getOptionalKeys() + ["bias_tee", "bitpack"]
# TODO: find actual gain stages for airspay
# def getGainStages(self):
# return None