openwebrx-clone/owrx/source/rtl_sdr.py
2021-02-19 18:45:29 +01:00

31 lines
937 B
Python

from owrx.source.connector import ConnectorSource, ConnectorDeviceDescription
from owrx.command import Flag, Option
from typing import List
from owrx.form import Input, TextInput
from owrx.form.converter import OptionalConverter
class RtlSdrSource(ConnectorSource):
def getCommandMapper(self):
return (
super()
.getCommandMapper()
.setBase("rtl_connector")
.setMappings({"bias_tee": Flag("-b"), "direct_sampling": Option("-e")})
)
class RtlSdrDeviceDescription(ConnectorDeviceDescription):
def getInputs(self) -> List[Input]:
return self.mergeInputs(
super().getInputs(),
[
TextInput(
"device",
"Device identifier",
infotext="Device serial number or index",
converter=OptionalConverter(),
),
],
)