From 7f5253594d631c7b3beb06147e5cfdf1f06ba7f5 Mon Sep 17 00:00:00 2001 From: Dieter Spaar Date: Thu, 29 Jul 2010 20:29:34 +0200 Subject: Don't abort if we have Rx bit errors but try to correct them --- gsm-receiver/src/lib/decoder/cch.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/gsm-receiver/src/lib/decoder/cch.c b/gsm-receiver/src/lib/decoder/cch.c index f1da56d..c6da29d 100644 --- a/gsm-receiver/src/lib/decoder/cch.c +++ b/gsm-receiver/src/lib/decoder/cch.c @@ -405,8 +405,6 @@ static unsigned char *decode_sacch(GS_CTX *ctx, unsigned char *burst, unsigned i // Viterbi decode errors = conv_decode(decoded_data, conv_data); //DEBUGF("conv_decode: %d\n", errors); - if (errors) - return NULL; // check parity // If parity check error detected try to fix it. @@ -417,15 +415,18 @@ static unsigned char *decode_sacch(GS_CTX *ctx, unsigned char *burst, unsigned i if (FC_check_crc(&fc_ctx, decoded_data, crc_result) == 0) { errors = -1; - DEBUGF("error: sacch: parity error (%d)\n", errors); + DEBUGF("error: sacch: parity error (%d fn=%d)\n", errors, ctx->fn); return NULL; } else { - DEBUGF("Successfully corrected parity bits!\n"); + DEBUGF("Successfully corrected parity bits! (errors=%d fn=%d)\n", errors, ctx->fn); memcpy(decoded_data, crc_result, sizeof crc_result); errors = 0; } } + if (errors) + printf("WRN: errors=%d fn=%d\n", errors, ctx->fn); + if((len = compress_bits(ctx->msg, data_size, decoded_data, DATA_BLOCK_SIZE)) < 0) { fprintf(stderr, "error: compress_bits\n"); -- cgit v1.2.3