aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bts-trx/trx_if.c
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2013-02-24 11:09:19 +0100
committerHarald Welte <laforge@gnumonks.org>2015-09-22 16:41:27 +0200
commit219ece83a3ffe7fa2bd58943cddb47a3eacc2fab (patch)
tree0a15b4b0e68a2f7b4a199d7d811b56be12e8069a /src/osmo-bts-trx/trx_if.c
parent889890da4312916bd617b3c95326a89237078a3b (diff)
TRX: Implementation of MS power and timing advance loops
Diffstat (limited to 'src/osmo-bts-trx/trx_if.c')
-rw-r--r--src/osmo-bts-trx/trx_if.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/osmo-bts-trx/trx_if.c b/src/osmo-bts-trx/trx_if.c
index 6420fdb4..bca9cdca 100644
--- a/src/osmo-bts-trx/trx_if.c
+++ b/src/osmo-bts-trx/trx_if.c
@@ -41,6 +41,9 @@
#include "trx_if.h"
#include "scheduler.h"
+/* enable to print RSSI level graph */
+//#define TOA_RSSI_DEBUG
+
int tranceiver_available = 0;
const char *tranceiver_ip = "127.0.0.1";
@@ -384,7 +387,7 @@ static int trx_data_read_cb(struct osmo_fd *ofd, unsigned int what)
}
tn = buf[0];
fn = (buf[1] << 24) | (buf[2] << 16) | (buf[3] << 8) | buf[4];
- rssi = (int8_t)buf[5];
+ rssi = -(int8_t)buf[5];
toa = ((int16_t)(buf[6] << 8) | buf[7]) / 256.0F;
/* copy and convert bits {254..0} to sbits {-127..127} */
@@ -407,6 +410,15 @@ static int trx_data_read_cb(struct osmo_fd *ofd, unsigned int what)
LOGP(DTRX, LOGL_DEBUG, "RX burst tn=%u fn=%u rssi=%d toa=%.2f\n",
tn, fn, rssi, toa);
+#ifdef TOA_RSSI_DEBUG
+ char deb[128];
+
+ sprintf(deb, "| 0 "
+ " | rssi=%4d toa=%4.2f fn=%u", rssi, toa, fn);
+ deb[1 + (128 + rssi) / 4] = '*';
+ fprintf(stderr, "%s\n", deb);
+#endif
+
trx_sched_ul_burst(l1h, tn, fn, bits, rssi, toa);
return 0;