aboutsummaryrefslogtreecommitdiffstats
path: root/lib/decoding
diff options
context:
space:
mode:
authorptrkrysik <ptrkrysik@gmail.com>2014-11-21 10:11:05 +0100
committerptrkrysik <ptrkrysik@gmail.com>2014-11-21 10:11:05 +0100
commit617ba03ffc3e50ddc96baaa99d74ed530aa4a0cb (patch)
tree35e9dbd05e1c540fbe5adf9e2b7a54290b38cac2 /lib/decoding
parent12fe7a024a934d08ff90ed9bbf40c85ce633486c (diff)
Changed format of messages containing bursts to PDU. Corrected types of bursts.
Diffstat (limited to 'lib/decoding')
-rw-r--r--lib/decoding/control_channels_decoder_impl.cc23
1 files changed, 13 insertions, 10 deletions
diff --git a/lib/decoding/control_channels_decoder_impl.cc b/lib/decoding/control_channels_decoder_impl.cc
index a5ac83c..404796f 100644
--- a/lib/decoding/control_channels_decoder_impl.cc
+++ b/lib/decoding/control_channels_decoder_impl.cc
@@ -26,6 +26,8 @@
#include <gsm/gsmtap.h>
#include "control_channels_decoder_impl.h"
+#define DATA_BYTES 23
+
namespace gr {
namespace gsm {
@@ -80,8 +82,8 @@ namespace gr {
//reorganize data
for(int ii = 0; ii < 4; ii++)
{
- pmt::pmt_t burst_content = pmt::cdr(d_bursts[ii]);
- int8_t * burst_bits = (int8_t *)pmt::blob_data(burst_content);
+ pmt::pmt_t header_plus_burst = pmt::cdr(d_bursts[ii]);
+ int8_t * burst_bits = (int8_t *)(pmt::blob_data(header_plus_burst))+sizeof(gsmtap_hdr);
for(int jj = 0; jj < 57; jj++)
{
@@ -131,16 +133,17 @@ namespace gr {
}
//send message with header of the first burst
- pmt::pmt_t header_blob = pmt::car(d_bursts[0]);
- gsmtap_hdr * header = (gsmtap_hdr *)pmt::blob_data(header_blob);
+ pmt::pmt_t first_header_plus_burst = pmt::cdr(d_bursts[0]);
+ gsmtap_hdr * header = (gsmtap_hdr *)pmt::blob_data(first_header_plus_burst);
header->type = GSMTAP_TYPE_UM;
- 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);
+ int8_t * header_content = (int8_t *)header;
+
+ int8_t header_plus_data[sizeof(gsmtap_hdr)+DATA_BYTES];
+ memcpy(header_plus_data, header_content, sizeof(gsmtap_hdr));
+ memcpy(header_plus_data+sizeof(gsmtap_hdr), outmsg, DATA_BYTES);
+
+ pmt::pmt_t msg_binary_blob = pmt::make_blob(header_plus_data,DATA_BYTES+sizeof(gsmtap_hdr));
pmt::pmt_t msg_out = pmt::cons(pmt::PMT_NIL, msg_binary_blob);
message_port_pub(pmt::mp("msgs"), msg_out);