Changes in control channels decoder to output messages in PDU format - when connected to Socket PDU the messages can be dissected with Wireshark now. The information in the header might be not complete/fully correct at this moment (no SNR, power measurements, channel type statically set to BCCH).

This commit is contained in:
ptrkrysik 2014-10-30 08:57:27 +01:00
parent 865d936b12
commit 7f61c6440c
3 changed files with 22 additions and 12 deletions

View File

@ -37,7 +37,7 @@ namespace gr {
}
/*
* The private constructor
* Constructor
*/
control_channels_decoder_impl::control_channels_decoder_impl()
: gr::block("control_channels_decoder",
@ -53,16 +53,16 @@ namespace gr {
j = 2 * ((49 * k) % 57) + ((k % 8) / 4);
interleave_trans[k] = B * 114 + j; //114=57 + 57
}
//initialize decoder
FC_init(&fc_ctx, 40, 184);
//setup input/output ports
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("msgs"));
}
/*
* Our virtual destructor.
*/
control_channels_decoder_impl::~control_channels_decoder_impl()
{
}
@ -131,8 +131,18 @@ namespace gr {
//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);
gsmtap_hdr * header = (gsmtap_hdr *)pmt::blob_data(header_blob);
header->type = GSMTAP_TYPE_UM;
header->sub_type = GSMTAP_CHANNEL_BCCH;
int8_t * header_content = (int8_t *)pmt::blob_data(header_blob);
int8_t header_plus_data[16+23];
memcpy(header_plus_data, header_content, 16);
memcpy(header_plus_data+16, outmsg, 23);
pmt::pmt_t msg_binary_blob = pmt::make_blob(header_plus_data,23+16);
pmt::pmt_t msg_out = pmt::cons(pmt::PMT_NIL, msg_binary_blob);
message_port_pub(pmt::mp("msgs"), msg_out);
}
return;

View File

@ -24,6 +24,7 @@
#include <gnuradio/io_signature.h>
#include "message_printer_impl.h"
#include "gsm/gsmtap.h"
namespace gr {
namespace gsm {
@ -35,9 +36,9 @@ namespace gr {
size_t message_len=pmt::blob_length(message);
// pmt::pmt_t header_blob = pmt::car(msg);
// gsmtap_hdr * header = (gsmtap_hdr *)pmt::blob_data(header_blob);
for(int ii=0; ii<message_len; ii++)
gsmtap_hdr * header = (gsmtap_hdr *)message_elements;
for(int ii=(header->hdr_len*4); ii<message_len; ii++)
{
printf(" %02x", message_elements[ii]);
}

View File

@ -758,11 +758,10 @@ int receiver_impl::get_norm_chan_imp_resp(const gr_complex *input, gr_complex *
void receiver_impl::send_burst(burst_counter burst_nr, const unsigned char * burst_binary, burst_type b_type)
{
boost::scoped_ptr<gsmtap_hdr> tap_header(new gsmtap_hdr());
tap_header->version = GSMTAP_VERSION;
tap_header->hdr_len = BURST_SIZE/4;
tap_header->hdr_len = sizeof(gsmtap_hdr)/4;
tap_header->type = GSMTAP_TYPE_UM_BURST;
tap_header->timeslot = static_cast<uint8_t>(d_burst_nr.get_timeslot_nr());
tap_header->frame_number = d_burst_nr.get_frame_nr();