aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2019-01-19 12:16:17 +0700
committerPiotr Krysik <ptrkrysik@gmail.com>2019-07-18 10:31:27 +0200
commitad0c62a41cc66d2dcfce13455b1fbe3ebf72c191 (patch)
tree95e82a54e805e9d9f9a9499e7b6c56c74153330e
parent25203809c14423e7e8cdf30062b59d110be9272b (diff)
apps/grgsm_trx: add RadioInterface driver selection argument
-rwxr-xr-xapps/grgsm_trx12
-rw-r--r--python/trx/__init__.py2
2 files changed, 10 insertions, 4 deletions
diff --git a/apps/grgsm_trx b/apps/grgsm_trx
index b911719..7da9e06 100755
--- a/apps/grgsm_trx
+++ b/apps/grgsm_trx
@@ -29,7 +29,6 @@ from argparse import ArgumentParser
from argparse import ArgumentTypeError
from gnuradio import eng_notation
-from grgsm.trx import RadioInterfaceUHD
from grgsm.trx import RadioInterface
from grgsm.trx import Transceiver
@@ -58,8 +57,13 @@ class Application:
# Set up signal handlers
signal.signal(signal.SIGINT, self.sig_handler)
+ if argv.driver == "uhd":
+ from grgsm.trx.radio_if_uhd import RadioInterfaceUHD as Radio
+ else:
+ raise ValueError("Unknown RadioInterface driver '%s'" % argv.driver)
+
# Init Radio interface
- self.radio = RadioInterfaceUHD(self.phy_args, self.phy_sample_rate,
+ self.radio = Radio(self.phy_args, self.phy_sample_rate,
self.phy_rx_gain, self.phy_tx_gain, self.phy_ppm,
self.phy_rx_antenna, self.phy_tx_antenna,
self.phy_freq_offset, self.bind_addr,
@@ -111,6 +115,10 @@ def parse_argv():
# PHY specific
phy_group = parser.add_argument_group("PHY parameters")
+ phy_group.add_argument("--driver",
+ dest = "driver", type = str, default = "uhd",
+ choices = ["uhd"],
+ help = "Set device driver (default %(default)s)")
phy_group.add_argument("-a", "--args",
dest = "args", type = str, default = "",
help = "Set device arguments")
diff --git a/python/trx/__init__.py b/python/trx/__init__.py
index 17ff9d7..c8bddbe 100644
--- a/python/trx/__init__.py
+++ b/python/trx/__init__.py
@@ -23,9 +23,7 @@ This is a set of helper classes for the grgsm_trx application.
from udp_link import UDPLink
from ctrl_if import CTRLInterface
from ctrl_if_bb import CTRLInterfaceBB
-from radio_if_grc import RadioInterfaceGRC
from radio_if import RadioInterface
-from radio_if import RadioInterfaceUHD
from transceiver import Transceiver
from dict_toggle_sign import dict_toggle_sign