Change in osmocom-bb[master]: fake_trx: introduce CTRL commands for RSSI simulation

2018-10-23 Thread Pau Espin Pedrol
Pau Espin Pedrol has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/11432 )

Change subject: fake_trx: introduce CTRL commands for RSSI simulation
..

fake_trx: introduce CTRL commands for RSSI simulation

Since FakeTRX is a proxy, it basically emulates transceiver for
both osmo-bts-trx and trxcon, hence there are two separate and
independent control interfaces (usually, ports 6701 and 5701).

All simulation commands (see 'FAKE_*') are usually implemented
on both interfaces separately:

  - ctrl_if_bb.py - simulation commands affecting Uplink,
  - ctrl_if_bts.py - simulation commands affecting Downlink.

This change introduces the 'FAKE_RSSI' command for both CTRL
interfaces in two variations:

  - absolute: CMD FAKE_RSSI  
  - relative: CMD FAKE_RSSI <+-BASE_DELTA>

where 'THRESH' affects optional value randomization.

Change-Id: Ic01c31fb0304345dd7337c3ee1c7ee3c2d3e8460
---
M src/target/trx_toolkit/ctrl_if_bb.py
M src/target/trx_toolkit/ctrl_if_bts.py
2 files changed, 42 insertions(+), 0 deletions(-)

Approvals:
  Jenkins Builder: Verified
  Pau Espin Pedrol: Looks good to me, approved



diff --git a/src/target/trx_toolkit/ctrl_if_bb.py 
b/src/target/trx_toolkit/ctrl_if_bb.py
index 808c880..3528c98 100644
--- a/src/target/trx_toolkit/ctrl_if_bb.py
+++ b/src/target/trx_toolkit/ctrl_if_bb.py
@@ -144,6 +144,27 @@

return 0

+   # RSSI simulation for Uplink
+   # Absolute form: CMD FAKE_RSSI  
+   elif self.verify_cmd(request, "FAKE_RSSI", 2):
+   print("[i] Recv FAKE_RSSI cmd")
+
+   # Parse and apply both base and threshold
+   self.burst_fwd.rssi_ul_base = int(request[1])
+   self.burst_fwd.rssi_ul_threshold = int(request[2])
+
+   return 0
+
+   # RSSI simulation for Uplink
+   # Relative form: CMD FAKE_RSSI <+-BASE_DELTA>
+   elif self.verify_cmd(request, "FAKE_RSSI", 1):
+   print("[i] Recv FAKE_RSSI cmd")
+
+   # Parse and apply delta
+   self.burst_fwd.rssi_ul_base += int(request[1])
+
+   return 0
+
# Path loss simulation for UL: burst dropping
# Syntax: CMD FAKE_DROP 
# Dropping pattern: fn % 1 == 0
diff --git a/src/target/trx_toolkit/ctrl_if_bts.py 
b/src/target/trx_toolkit/ctrl_if_bts.py
index 72a0371..6ac8ffb 100644
--- a/src/target/trx_toolkit/ctrl_if_bts.py
+++ b/src/target/trx_toolkit/ctrl_if_bts.py
@@ -118,6 +118,27 @@

return 0

+   # RSSI simulation for Downlink
+   # Absolute form: CMD FAKE_RSSI  
+   elif self.verify_cmd(request, "FAKE_RSSI", 2):
+   print("[i] Recv FAKE_RSSI cmd")
+
+   # Parse and apply both base and threshold
+   self.burst_fwd.rssi_dl_base = int(request[1])
+   self.burst_fwd.rssi_dl_threshold = int(request[2])
+
+   return 0
+
+   # RSSI simulation for Downlink
+   # Relative form: CMD FAKE_RSSI <+-BASE_DELTA>
+   elif self.verify_cmd(request, "FAKE_RSSI", 1):
+   print("[i] Recv FAKE_RSSI cmd")
+
+   # Parse and apply delta
+   self.burst_fwd.rssi_dl_base += int(request[1])
+
+   return 0
+
# Path loss simulation for DL: burst dropping
# Syntax: CMD FAKE_DROP 
# Dropping pattern: fn % 1 == 0

--
To view, visit https://gerrit.osmocom.org/11432
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ic01c31fb0304345dd7337c3ee1c7ee3c2d3e8460
Gerrit-Change-Number: 11432
Gerrit-PatchSet: 2
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: Vadim Yanitskiy 


Change in osmocom-bb[master]: fake_trx: introduce CTRL commands for RSSI simulation

2018-10-23 Thread Pau Espin Pedrol
Pau Espin Pedrol has posted comments on this change. ( 
https://gerrit.osmocom.org/11432 )

Change subject: fake_trx: introduce CTRL commands for RSSI simulation
..


Patch Set 2: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/11432
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ic01c31fb0304345dd7337c3ee1c7ee3c2d3e8460
Gerrit-Change-Number: 11432
Gerrit-PatchSet: 2
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Comment-Date: Tue, 23 Oct 2018 07:59:06 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmocom-bb[master]: fake_trx: introduce CTRL commands for RSSI simulation

2018-10-23 Thread Pau Espin Pedrol
Pau Espin Pedrol has posted comments on this change. ( 
https://gerrit.osmocom.org/11432 )

Change subject: fake_trx: introduce CTRL commands for RSSI simulation
..


Patch Set 2: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/11432
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ic01c31fb0304345dd7337c3ee1c7ee3c2d3e8460
Gerrit-Change-Number: 11432
Gerrit-PatchSet: 2
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Comment-Date: Tue, 23 Oct 2018 07:58:39 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmocom-bb[master]: fake_trx: introduce CTRL commands for RSSI simulation

2018-10-22 Thread Vadim Yanitskiy
Vadim Yanitskiy has uploaded a new patch set (#2) to the change originally 
created by Pau Espin Pedrol. ( https://gerrit.osmocom.org/11432 )

Change subject: fake_trx: introduce CTRL commands for RSSI simulation
..

fake_trx: introduce CTRL commands for RSSI simulation

Since FakeTRX is a proxy, it basically emulates transceiver for
both osmo-bts-trx and trxcon, hence there are two separate and
independent control interfaces (usually, ports 6701 and 5701).

All simulation commands (see 'FAKE_*') are usually implemented
on both interfaces separately:

  - ctrl_if_bb.py - simulation commands affecting Uplink,
  - ctrl_if_bts.py - simulation commands affecting Downlink.

This change introduces the 'FAKE_RSSI' command for both CTRL
interfaces in two variations:

  - absolute: CMD FAKE_RSSI  
  - relative: CMD FAKE_RSSI <+-BASE_DELTA>

where 'THRESH' affects optional value randomization.

Change-Id: Ic01c31fb0304345dd7337c3ee1c7ee3c2d3e8460
---
M src/target/trx_toolkit/ctrl_if_bb.py
M src/target/trx_toolkit/ctrl_if_bts.py
2 files changed, 42 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/32/11432/2
--
To view, visit https://gerrit.osmocom.org/11432
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ic01c31fb0304345dd7337c3ee1c7ee3c2d3e8460
Gerrit-Change-Number: 11432
Gerrit-PatchSet: 2
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Vadim Yanitskiy