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
|
2021-02-20 19:20:31 +01:00
|
|
|
from typing import List
|
2020-08-16 21:49:52 +02:00
|
|
|
|
|
|
|
|
|
|
|
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(),
|
|
|
|
}
|
|
|
|
)
|
2020-08-16 21:49:52 +02:00
|
|
|
)
|
2021-02-20 18:09:24 +01:00
|
|
|
|
|
|
|
|
|
|
|
class RtlTcpDeviceDescription(ConnectorDeviceDescription):
|
2021-04-17 17:42:08 +02:00
|
|
|
def getName(self):
|
|
|
|
return "RTL-SDR device (via rtl_tcp)"
|
|
|
|
|
2021-02-20 19:20:31 +01:00
|
|
|
def getInputs(self) -> List[Input]:
|
2021-02-22 00:35:47 +01:00
|
|
|
return super().getInputs() + [RemoteInput()]
|
|
|
|
|
2021-03-24 23:17:50 +01:00
|
|
|
def getDeviceMandatoryKeys(self):
|
2021-04-02 21:46:21 +02:00
|
|
|
return super().getDeviceMandatoryKeys() + ["remote"]
|