summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2013-02-27 16:26:06 +0100
committerAndreas Eversberg <jolly@eversberg.eu>2013-02-27 16:40:37 +0100
commit50dd2b33d80902f3c0bc30e5cadb3c66a059f208 (patch)
treeb771f0071154b8bb1b239989da113b007ba7db8a /src
parent687bc2318d18073d02756ef6ea5b96799f4b9aa7 (diff)
Add option to transceiver application, to use second phone for TS 1
Diffstat (limited to 'src')
-rw-r--r--src/host/layer23/src/transceiver/main.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/src/host/layer23/src/transceiver/main.c b/src/host/layer23/src/transceiver/main.c
index c2a8748b..47c7fff6 100644
--- a/src/host/layer23/src/transceiver/main.c
+++ b/src/host/layer23/src/transceiver/main.c
@@ -43,6 +43,7 @@
void *l23_ctx = NULL;
static int arfcn_sync = 0;
static int daemonize = 0;
+static int second_phone = 0;
static void print_help(char *argv[])
{
@@ -56,6 +57,7 @@ static void print_help(char *argv[])
" -s --disable-color Don't use colors in stderr log output\n"
" -a --arfcn-sync ARFCN Set ARFCN to sync to\n"
" -p --arfcn-sync-pcs The ARFCN above is PCS\n"
+ " -2 --second-phone Use second phone for TS 1\n"
);
}
@@ -71,9 +73,10 @@ static void handle_options(int argc, char **argv, struct app_state *as)
{ "disable-color", 0, 0, 's' },
{ "arfcn-sync", 1, 0, 'a' },
{ "arfcn-sync-pcs", 0, 0, 'p' },
+ { "second-phone", 0, 0, '2' },
};
- c = getopt_long(argc, argv, "hd:e:Dsa:p",
+ c = getopt_long(argc, argv, "hd:e:Dsa:p2",
long_options, &option_idx);
if (c == -1)
@@ -103,6 +106,9 @@ static void handle_options(int argc, char **argv, struct app_state *as)
case 'e':
log_set_log_level(as->stderr_target, atoi(optarg));
break;
+ case '2':
+ second_phone = 1;
+ break;
default:
fprintf(stderr, "Unknow option %s\n", optarg);
exit(0);
@@ -172,6 +178,23 @@ int main(int argc, char *argv[])
/* Reset phone */
l1ctl_tx_reset_req(&as->l1l[0], L1CTL_RES_T_FULL);
+ if (second_phone) {
+ /* Establish l1ctl link */
+ rv = l1l_open(&as->l1l[1], "/tmp/osmocom_l2.2", l1ctl_recv, &as->l1l[1]);
+ if (rv)
+ exit(-1);
+ as->l1l[1].trx = as->trx[0];
+ as->l1l[1].as = as;
+ as->l1l[1].tx_mask = 0x02; /* TS 1 */
+ as->l1l[1].rx_mask = 0x02; /* TS 1 */
+ as->l1l[0].tx_mask = 0xe1; /* TS 5,6,7,0 */
+ as->l1l[0].rx_mask = 0x01; /* TS 0 */
+ as->trx[0]->l1l[1] = &as->l1l[1];
+
+ /* Reset phone */
+ l1ctl_tx_reset_req(&as->l1l[1], L1CTL_RES_T_FULL);
+ }
+
if (daemonize) {
rv = osmo_daemonize();
if (rv < 0) {