2021-02-20 17:09:24 +00:00
|
|
|
from owrx.source.connector import ConnectorSource, ConnectorDeviceDescription
|
2020-08-16 21:22:46 +00:00
|
|
|
from owrx.command import Flag, Option, Argument
|
2021-02-20 18:20:31 +00:00
|
|
|
from owrx.form import Input
|
|
|
|
from owrx.form.device import RemoteInput
|
|
|
|
from typing import List
|
2020-08-16 19:49:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
class RtlTcpSource(ConnectorSource):
|
|
|
|
def getCommandMapper(self):
|
|
|
|
return (
|
|
|
|
super()
|
|
|
|
.getCommandMapper()
|
|
|
|
.setBase("rtl_tcp_connector")
|
2021-01-20 16:01:46 +00:00
|
|
|
.setMappings(
|
|
|
|
{
|
|
|
|
"bias_tee": Flag("-b"),
|
|
|
|
"direct_sampling": Option("-e"),
|
|
|
|
"remote": Argument(),
|
|
|
|
}
|
|
|
|
)
|
2020-08-16 19:49:52 +00:00
|
|
|
)
|
2021-02-20 17:09:24 +00:00
|
|
|
|
|
|
|
|
|
|
|
class RtlTcpDeviceDescription(ConnectorDeviceDescription):
|
2021-02-20 18:20:31 +00:00
|
|
|
def getInputs(self) -> List[Input]:
|
2021-02-21 23:35:47 +00:00
|
|
|
return super().getInputs() + [RemoteInput()]
|
|
|
|
|
2021-03-24 22:17:50 +00:00
|
|
|
def getDeviceMandatoryKeys(self):
|
|
|
|
return super().getDeviceMandatoryKeys() + ["device"]
|