openwebrx/owrx/source/rtl_tcp.py

43 lines
1.3 KiB
Python
Raw Permalink Normal View History

2021-02-20 18:09:24 +01:00
from owrx.source.connector import ConnectorSource, ConnectorDeviceDescription
2020-08-16 23:22:46 +02:00
from owrx.command import Flag, Option, Argument
2021-04-29 15:17:21 +02:00
from owrx.form.input import Input
from owrx.form.input.device import RemoteInput, DirectSamplingInput
2024-01-17 22:39:05 +01:00
from owrx.form.input.validator import Range
2021-02-20 19:20:31 +01:00
from typing import List
class RtlTcpSource(ConnectorSource):
def getCommandMapper(self):
return (
super()
.getCommandMapper()
.setBase("rtl_tcp_connector")
2021-01-20 17:01:46 +01:00
.setMappings(
{
"bias_tee": Flag("-b"),
"direct_sampling": Option("-e"),
"remote": Argument(),
}
)
)
2021-02-20 18:09:24 +01:00
class RtlTcpDeviceDescription(ConnectorDeviceDescription):
def getName(self):
return "RTL-SDR device (via rtl_tcp)"
2021-02-20 19:20:31 +01:00
def getInputs(self) -> List[Input]:
return super().getInputs() + [RemoteInput(), DirectSamplingInput()]
def getDeviceMandatoryKeys(self):
return super().getDeviceMandatoryKeys() + ["remote"]
def getDeviceOptionalKeys(self):
return super().getDeviceOptionalKeys() + ["direct_sampling"]
def getProfileOptionalKeys(self):
return super().getProfileOptionalKeys() + ["direct_sampling"]
2024-01-17 22:39:05 +01:00
def getSampleRateRanges(self) -> List[Range]:
2024-01-17 22:39:05 +01:00
return [Range(250000, 3200000)]