summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2011-01-23 12:06:35 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2011-01-23 14:29:44 +0100
commitf9a699e68246142ef939c9f80c303e55671f19ed (patch)
treed02562afda52c03e32a32b69120a0c2f0c1f14f9
parent661d9a33e10548d53fe09297b1e5b449a0de12da (diff)
ccch: Stop using fprintf for the SI
Stop using fprintf to print the System Information number of the data we get. For the check use LOGP with LOGL_ERROR. There is little use in this information.
-rw-r--r--src/host/layer23/src/misc/app_ccch_scan.c43
1 files changed, 13 insertions, 30 deletions
diff --git a/src/host/layer23/src/misc/app_ccch_scan.c b/src/host/layer23/src/misc/app_ccch_scan.c
index b4e4b6ff..c12e7199 100644
--- a/src/host/layer23/src/misc/app_ccch_scan.c
+++ b/src/host/layer23/src/misc/app_ccch_scan.c
@@ -56,10 +56,9 @@ static void dump_bcch(struct osmocom_ms *ms, uint8_t tc, const uint8_t *data)
/* GSM 05.02 ยง6.3.1.3 Mapping of BCCH data */
switch (si_hdr->system_information) {
case GSM48_MT_RR_SYSINFO_1:
- fprintf(stderr, "\tSI1");
#ifdef BCCH_TC_CHECK
if (tc != 0)
- fprintf(stderr, " on wrong TC");
+ LOGP(DRR, LOGL_ERROR, "SI1 on the wrong TC: %d\n", tc);
#endif
if (!app_state.has_si1) {
struct gsm48_system_information_type_1 *si1 =
@@ -71,20 +70,19 @@ static void dump_bcch(struct osmocom_ms *ms, uint8_t tc, const uint8_t *data)
0xff, 0x01);
app_state.has_si1 = 1;
+ LOGP(DRR, LOGL_ERROR, "SI1 received.\n");
}
break;
case GSM48_MT_RR_SYSINFO_2:
- fprintf(stderr, "\tSI2");
#ifdef BCCH_TC_CHECK
if (tc != 1)
- fprintf(stderr, " on wrong TC");
+ LOGP(DRR, LOGL_ERROR, "SI2 on the wrong TC: %d\n", tc);
#endif
break;
case GSM48_MT_RR_SYSINFO_3:
- fprintf(stderr, "\tSI3");
#ifdef BCCH_TC_CHECK
if (tc != 2 && tc != 6)
- fprintf(stderr, " on wrong TC");
+ LOGP(DRR, LOGL_ERROR, "SI3 on the wrong TC: %d\n", tc);
#endif
if (app_state.ccch_mode == CCCH_MODE_NONE) {
struct gsm48_system_information_type_3 *si3 =
@@ -99,86 +97,71 @@ static void dump_bcch(struct osmocom_ms *ms, uint8_t tc, const uint8_t *data)
}
break;
case GSM48_MT_RR_SYSINFO_4:
- fprintf(stderr, "\tSI4");
#ifdef BCCH_TC_CHECK
if (tc != 3 && tc != 7)
- fprintf(stderr, " on wrong TC");
+ LOGP(DRR, LOGL_ERROR, "SI4 on the wrong TC: %d\n", tc);
#endif
break;
case GSM48_MT_RR_SYSINFO_5:
- fprintf(stderr, "\tSI5");
break;
case GSM48_MT_RR_SYSINFO_6:
- fprintf(stderr, "\tSI6");
break;
case GSM48_MT_RR_SYSINFO_7:
- fprintf(stderr, "\tSI7");
#ifdef BCCH_TC_CHECK
if (tc != 7)
- fprintf(stderr, " on wrong TC");
+ LOGP(DRR, LOGL_ERROR, "SI7 on the wrong TC: %d\n", tc);
#endif
break;
case GSM48_MT_RR_SYSINFO_8:
- fprintf(stderr, "\tSI8");
#ifdef BCCH_TC_CHECK
if (tc != 3)
- fprintf(stderr, " on wrong TC");
+ LOGP(DRR, LOGL_ERROR, "SI8 on the wrong TC: %d\n", tc);
#endif
break;
case GSM48_MT_RR_SYSINFO_9:
- fprintf(stderr, "\tSI9");
#ifdef BCCH_TC_CHECK
if (tc != 4)
- fprintf(stderr, " on wrong TC");
+ LOGP(DRR, LOGL_ERROR, "SI9 on the wrong TC: %d\n", tc);
#endif
break;
case GSM48_MT_RR_SYSINFO_13:
- fprintf(stderr, "\tSI13");
#ifdef BCCH_TC_CHECK
if (tc != 4 && tc != 0)
- fprintf(stderr, " on wrong TC");
+ LOGP(DRR, LOGL_ERROR, "SI13 on the wrong TC: %d\n", tc);
#endif
break;
case GSM48_MT_RR_SYSINFO_16:
- fprintf(stderr, "\tSI16");
#ifdef BCCH_TC_CHECK
if (tc != 6)
- fprintf(stderr, " on wrong TC");
+ LOGP(DRR, LOGL_ERROR, "SI16 on the wrong TC: %d\n", tc);
#endif
break;
case GSM48_MT_RR_SYSINFO_17:
- fprintf(stderr, "\tSI17");
#ifdef BCCH_TC_CHECK
if (tc != 2)
- fprintf(stderr, " on wrong TC");
+ LOGP(DRR, LOGL_ERROR, "SI17 on the wrong TC: %d\n", tc);
#endif
break;
case GSM48_MT_RR_SYSINFO_2bis:
- fprintf(stderr, "\tSI2bis");
#ifdef BCCH_TC_CHECK
if (tc != 5)
- fprintf(stderr, " on wrong TC");
+ LOGP(DRR, LOGL_ERROR, "SI2bis on the wrong TC: %d\n", tc);
#endif
break;
case GSM48_MT_RR_SYSINFO_2ter:
- fprintf(stderr, "\tSI2ter");
#ifdef BCCH_TC_CHECK
if (tc != 5 && tc != 4)
- fprintf(stderr, " on wrong TC");
+ LOGP(DRR, LOGL_ERROR, "SI2ter on the wrong TC: %d\n", tc);
#endif
break;
case GSM48_MT_RR_SYSINFO_5bis:
- fprintf(stderr, "\tSI5bis");
break;
case GSM48_MT_RR_SYSINFO_5ter:
- fprintf(stderr, "\tSI5ter");
break;
default:
fprintf(stderr, "\tUnknown SI");
break;
};
-
- fprintf(stderr, "\n");
}