aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2017-10-19 01:14:24 +0700
committerPiotr Krysik <ptrkrysik@users.noreply.github.com>2017-11-05 17:33:26 +0100
commit01c6afd49501e53fd5b01f6ee9818811db69f82b (patch)
treed1280b93e30c004b8a215e67f290c126b09fb445 /python
parentda5e21f1234b00435834e98e47db7901d98afe91 (diff)
trx/radio_if.py: fix RX / TX gain control
Diffstat (limited to 'python')
-rw-r--r--python/trx/ctrl_if_bb.py12
-rw-r--r--python/trx/radio_if.py8
2 files changed, 17 insertions, 3 deletions
diff --git a/python/trx/ctrl_if_bb.py b/python/trx/ctrl_if_bb.py
index 77e02d0..99c0451 100644
--- a/python/trx/ctrl_if_bb.py
+++ b/python/trx/ctrl_if_bb.py
@@ -72,12 +72,22 @@ class ctrl_if_bb(ctrl_if):
return 0
+ # Gain control
elif self.verify_cmd(request, "SETRXGAIN", 1):
print("[i] Recv SETRXGAIN cmd")
# TODO: check gain value
gain = int(request[1])
- self.tb.set_gain(gain)
+ self.tb.set_rx_gain(gain)
+
+ return 0
+
+ elif self.verify_cmd(request, "SETTXGAIN", 1):
+ print("[i] Recv SETTXGAIN cmd")
+
+ # TODO: check gain value
+ gain = int(request[1])
+ self.tb.set_tx_gain(gain)
return 0
diff --git a/python/trx/radio_if.py b/python/trx/radio_if.py
index 559c309..d8c0444 100644
--- a/python/trx/radio_if.py
+++ b/python/trx/radio_if.py
@@ -126,6 +126,10 @@ class radio_if(gr.top_block):
self.fc_set = True
self.fc = fc
- def set_gain(self, gain):
+ def set_rx_gain(self, gain):
self.phy.set_gain(gain, 0)
- self.gain = gain
+ self.rx_gain = gain
+
+ def set_tx_gain(self, gain):
+ # TODO: TX chain not implemented yet
+ self.tx_gain = gain