aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorpiotr <Piotr Krysik pkrysik@elka.pw.edu.pl>2014-08-04 11:30:43 +0200
committerpiotr <Piotr Krysik pkrysik@elka.pw.edu.pl>2014-08-04 11:30:43 +0200
commitb529a59a918b07dce960282de58e0181442daf32 (patch)
tree980e61bae1d2958e9b8691b55bdeca796b88f117 /lib
parentd06e4b16700a2c4efe53550c0199c99e99127be8 (diff)
Added output in the control channel decoder
Diffstat (limited to 'lib')
-rw-r--r--lib/decoding/control_channels_decoder_impl.cc18
1 files changed, 12 insertions, 6 deletions
diff --git a/lib/decoding/control_channels_decoder_impl.cc b/lib/decoding/control_channels_decoder_impl.cc
index 544e6bb..23ec7fd 100644
--- a/lib/decoding/control_channels_decoder_impl.cc
+++ b/lib/decoding/control_channels_decoder_impl.cc
@@ -57,7 +57,7 @@ namespace gr {
FC_init(&fc_ctx, 40, 184);
message_port_register_in(pmt::mp("bursts"));
set_msg_handler(pmt::mp("bursts"), boost::bind(&control_channels_decoder_impl::decode, this, _1));
-// message_port_register_out(pmt::mp(""));
+ message_port_register_out(pmt::mp("msgs"));
}
/*
@@ -73,8 +73,8 @@ 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);
+// 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 +109,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);
@@ -130,8 +130,7 @@ namespace gr {
}
outmsg[pos++] = c & 0xff;
}
-
- //printf("%6d %d:", (0 + 1), 0);
+
int jj=0;
while (jj < 23){
printf(" %02x", outmsg[jj]);//decoded_data[jj]);
@@ -139,6 +138,13 @@ namespace gr {
}
printf("\n");
fflush(stdout);
+
+ //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;
}