summaryrefslogtreecommitdiffstats
path: root/src/target/fake_trx/ctrl_if_bb.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/target/fake_trx/ctrl_if_bb.py')
-rw-r--r--src/target/fake_trx/ctrl_if_bb.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/target/fake_trx/ctrl_if_bb.py b/src/target/fake_trx/ctrl_if_bb.py
index 32b82d3..f840c09 100644
--- a/src/target/fake_trx/ctrl_if_bb.py
+++ b/src/target/fake_trx/ctrl_if_bb.py
@@ -29,6 +29,7 @@ class CTRLInterfaceBB(CTRLInterface):
trx_started = False
rx_freq = None
tx_freq = None
+ pm = None
def __init__(self, remote_addr, remote_port, bind_port):
print("[i] Init CTRL interface for BB")
@@ -79,6 +80,19 @@ class CTRLInterfaceBB(CTRLInterface):
self.tx_freq = int(request[1]) * 1000
return 0
+ # Power measurement
+ elif self.verify_cmd(request, "MEASURE", 1):
+ print("[i] Recv MEASURE cmd")
+
+ if self.pm is None:
+ return -1
+
+ # TODO: check freq range
+ meas_freq = int(request[1]) * 1000
+ meas_dbm = str(self.pm.measure(meas_freq))
+
+ return (0, [meas_dbm])
+
# Wrong / unknown command
else:
# We don't care about other commands,