diff options
author | piotr <Piotr Krysik pkrysik@elka.pw.edu.pl> | 2014-08-06 14:14:15 +0200 |
---|---|---|
committer | piotr <Piotr Krysik pkrysik@elka.pw.edu.pl> | 2014-08-06 14:14:15 +0200 |
commit | ab663c884480cc9030a5716d1389dc8b525afe82 (patch) | |
tree | 6c58982756b15de1b98cf7b45842f4df233b6679 /lib/decoding | |
parent | 510deeb455464000c4eaf577783790bcaffb7b67 (diff) |
Added new block for message printing, removed legacy code from the decoder and bursts printer
Diffstat (limited to 'lib/decoding')
-rw-r--r-- | lib/decoding/control_channels_decoder_impl.cc | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/lib/decoding/control_channels_decoder_impl.cc b/lib/decoding/control_channels_decoder_impl.cc index 23ec7fd..e9d1146 100644 --- a/lib/decoding/control_channels_decoder_impl.cc +++ b/lib/decoding/control_channels_decoder_impl.cc @@ -73,8 +73,6 @@ namespace gr { d_bursts[d_collected_bursts_num] = msg; d_collected_bursts_num++; //get convecutive bursts -// pmt::pmt_t header_blob = pmt::car(msg); -// gsmtap_hdr * header = (gsmtap_hdr *)pmt::blob_data(header_blob); if(d_collected_bursts_num==4) { @@ -109,7 +107,7 @@ namespace gr { if (FC_check_crc(&fc_ctx, decoded_data, crc_result) == 0) { //("error: sacch: parity error (errors=%d fn=%d)\n", errors, ctx->fn); - std::cout << "Uncorrectable errors!" << std::endl; + //std::cout << "Uncorrectable errors!" << std::endl; errors = -1; } else { //DEBUGF("Successfully corrected parity bits! (errors=%d fn=%d)\n", errors, ctx->fn); @@ -125,25 +123,16 @@ namespace gr { unsigned char sbuf_len=224; int i, j, c, pos=0; for(i = 0; i < sbuf_len; i += 8) { - for(j = 0, c = 0; (j < 8) && (i + j < sbuf_len); j++){ - c |= (!!decoded_data[i + j]) << j; - } - outmsg[pos++] = c & 0xff; - } - - int jj=0; - while (jj < 23){ - printf(" %02x", outmsg[jj]);//decoded_data[jj]); - jj++; - } - printf("\n"); - fflush(stdout); + for(j = 0, c = 0; (j < 8) && (i + j < sbuf_len); j++){ + c |= (!!decoded_data[i + j]) << j; + } + outmsg[pos++] = c & 0xff; + } //send message with header of the first burst pmt::pmt_t header_blob = pmt::car(d_bursts[0]); pmt::pmt_t msg_binary_blob = pmt::make_blob(outmsg,23); pmt::pmt_t msg_out = pmt::cons(header_blob, msg_binary_blob); - message_port_pub(pmt::mp("msgs"), msg_out); } return; |