Review at  https://gerrit.osmocom.org/7242

bts: Make PCU and TRXC sockets optional

If we want to test with a real (remote) BTS, we can neither access
the PCU socket nor is there any fake_trx control socket for fake
toa/rssi

Change-Id: Ibb02cf289b0d2e77170f146463822c164efc21cd
---
M bts/BTS_Tests.ttcn
1 file changed, 13 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/42/7242/1

diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn
index 2cf17ae..931c9ab 100644
--- a/bts/BTS_Tests.ttcn
+++ b/bts/BTS_Tests.ttcn
@@ -236,6 +236,10 @@
        timer T := 2.0;
        var PCUIF_send_data sd;
        map(self:PCU, system:PCU);
+       if (mp_pcu_socket == "") {
+               g_pcu_conn_id := -1;
+               return;
+       }
        g_pcu_conn_id := f_pcuif_connect(PCU, mp_pcu_socket);
 
        T.start;
@@ -265,9 +269,12 @@
 
        f_init_pcu(id);
 
-       /* start with a default moderate timing offset equalling TA=2 */
-       f_main_trxc_connect();
-       f_TRXC_transceive(BB_TRXC, g_bb_trxc_conn_id, 
valueof(ts_TRXC_FAKE_TIMING(2*256)));
+       if (mp_bb_trxc_port != -1) {
+               var TrxcMessage ret;
+               /* start with a default moderate timing offset equalling TA=2 */
+               f_main_trxc_connect();
+               ret := f_TRXC_transceive(BB_TRXC, g_bb_trxc_conn_id, 
valueof(ts_TRXC_FAKE_TIMING(2*256)));
+       }
 }
 
 /* Attach L1CTL to master test_CT (classic tests, non-handler mode) */
@@ -342,7 +349,9 @@
        map(self:L1CTL, system:L1CTL);
        f_connect_reset(L1CTL);
 
-       f_trxc_connect();
+       if (mp_bb_trxc_port != -1) {
+               f_trxc_connect();
+       }
 
        g_Tguard.start(pars.t_guard);
        activate(as_Tguard());

-- 
To view, visit https://gerrit.osmocom.org/7242
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibb02cf289b0d2e77170f146463822c164efc21cd
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <lafo...@gnumonks.org>

Reply via email to