aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2012-09-23 06:42:07 +0200
committerAndreas Eversberg <jolly@eversberg.eu>2012-09-23 06:42:07 +0200
commit514491d726008b45d3caaa8fb36e55bc2ff8311b (patch)
tree1dc43cb932991d3cfef7710cf98f37dc6a92b3fa
parentcd8a83a42c44a749a801cb53ec8e9888fcd153d0 (diff)
Fix: Correctly interpret MCC, MNC, CELL ID from BTS
-rw-r--r--src/gprs_bssgp_pcu.cpp4
-rw-r--r--src/pcu_l1_if.cpp6
2 files changed, 7 insertions, 3 deletions
diff --git a/src/gprs_bssgp_pcu.cpp b/src/gprs_bssgp_pcu.cpp
index 020df61..12d4582 100644
--- a/src/gprs_bssgp_pcu.cpp
+++ b/src/gprs_bssgp_pcu.cpp
@@ -529,6 +529,10 @@ int gprs_bssgp_create(uint32_t sgsn_ip, uint16_t sgsn_port, uint16_t nsei,
{
struct sockaddr_in dest;
+ mcc = ((mcc & 0xf00) >> 8) * 100 + ((mcc & 0x0f0) >> 4) * 10 + (mcc & 0x00f);
+ mnc = ((mnc & 0xf00) >> 8) * 100 + ((mnc & 0x0f0) >> 4) * 10 + (mnc & 0x00f);
+ cell_id = ntohs(cell_id);
+
if (bctx)
return 0; /* if already created, must return 0: no error */
diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp
index 2ed023a..1eeacfa 100644
--- a/src/pcu_l1_if.cpp
+++ b/src/pcu_l1_if.cpp
@@ -310,11 +310,11 @@ bssgp_failed:
return 0;
}
LOGP(DL1IF, LOGL_INFO, "BTS available\n");
- LOGP(DL1IF, LOGL_DEBUG, " mcc=%d\n", info_ind->mcc);
- LOGP(DL1IF, LOGL_DEBUG, " mnc=%d\n", info_ind->mnc);
+ LOGP(DL1IF, LOGL_DEBUG, " mcc=%x\n", info_ind->mcc);
+ LOGP(DL1IF, LOGL_DEBUG, " mnc=%x\n", info_ind->mnc);
LOGP(DL1IF, LOGL_DEBUG, " lac=%d\n", info_ind->lac);
LOGP(DL1IF, LOGL_DEBUG, " rac=%d\n", info_ind->rac);
- LOGP(DL1IF, LOGL_DEBUG, " cell_id=%d\n", info_ind->cell_id);
+ LOGP(DL1IF, LOGL_DEBUG, " cell_id=%d\n", ntohs(info_ind->cell_id));
LOGP(DL1IF, LOGL_DEBUG, " nsei=%d\n", info_ind->nsei);
LOGP(DL1IF, LOGL_DEBUG, " nse_timer=%d %d %d %d %d %d %d\n",
info_ind->nse_timer[0], info_ind->nse_timer[1],