aboutsummaryrefslogtreecommitdiffstats
path: root/lib/decoding/control_channels_decoder_impl.cc
diff options
context:
space:
mode:
authoriZsh <izsh@fail0verflow.com>2015-08-16 14:42:18 +0200
committeriZsh <izsh@fail0verflow.com>2015-08-16 14:52:01 +0200
commit6698793a241a3acfa2c2193ba363f5041b4ec22b (patch)
treea793bddd91b710644a0aba0526f017a6125fe249 /lib/decoding/control_channels_decoder_impl.cc
parentb9d8ce37900b1043e35bd2ea4eca1e69b3a44602 (diff)
Fix issue #112 (copy messages instead of modifying the input msg)
Diffstat (limited to 'lib/decoding/control_channels_decoder_impl.cc')
-rw-r--r--lib/decoding/control_channels_decoder_impl.cc7
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/decoding/control_channels_decoder_impl.cc b/lib/decoding/control_channels_decoder_impl.cc
index 3ea3fd9..1d25664 100644
--- a/lib/decoding/control_channels_decoder_impl.cc
+++ b/lib/decoding/control_channels_decoder_impl.cc
@@ -137,13 +137,10 @@ namespace gr {
//send message with header of the first burst
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 *)header;
-
int8_t header_plus_data[sizeof(gsmtap_hdr)+DATA_BYTES];
- memcpy(header_plus_data, header_content, sizeof(gsmtap_hdr));
+ memcpy(header_plus_data, header, sizeof(gsmtap_hdr));
memcpy(header_plus_data+sizeof(gsmtap_hdr), outmsg, DATA_BYTES);
+ ((gsmtap_hdr*)header_plus_data)->type = GSMTAP_TYPE_UM;
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);