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
|
|
|
|
from owrx.form.input.device import BiasTeeInput, DirectSamplingInput
|
2021-02-20 18:48:12 +01:00
|
|
|
from typing import List
|
2020-01-10 20:43:28 +01:00
|
|
|
|
|
|
|
|
|
|
|
class RtlSdrSoapySource(SoapyConnectorSource):
|
2020-03-14 01:04:52 +01:00
|
|
|
def getSoapySettingsMappings(self):
|
|
|
|
mappings = super().getSoapySettingsMappings()
|
2020-03-14 23:06:52 +01:00
|
|
|
mappings.update({"direct_sampling": "direct_samp", "bias_tee": "biastee"})
|
2020-03-14 01:04:52 +01:00
|
|
|
return mappings
|
2020-01-10 20:50:56 +01:00
|
|
|
|
2020-01-10 20:43:28 +01:00
|
|
|
def getDriver(self):
|
|
|
|
return "rtlsdr"
|
2021-02-20 18:09:24 +01:00
|
|
|
|
|
|
|
|
|
|
|
class RtlSdrSoapyDeviceDescription(SoapyConnectorDeviceDescription):
|
2021-04-17 17:42:08 +02:00
|
|
|
def getName(self):
|
|
|
|
return "RTL-SDR device (via SoapySDR)"
|
|
|
|
|
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(), DirectSamplingInput()]
|
|
|
|
|
2021-03-24 23:17:50 +01:00
|
|
|
def getDeviceOptionalKeys(self):
|
|
|
|
return super().getDeviceOptionalKeys() + ["bias_tee", "direct_sampling"]
|
2021-02-23 18:32:23 +01:00
|
|
|
|
|
|
|
def getProfileOptionalKeys(self):
|
|
|
|
return super().getProfileOptionalKeys() + ["bias_tee", "direct_sampling"]
|