aboutsummaryrefslogtreecommitdiffstats
path: root/lib/demapping
diff options
context:
space:
mode:
Diffstat (limited to 'lib/demapping')
-rw-r--r--lib/demapping/tch_f_chans_demapper_impl.cc28
-rw-r--r--lib/demapping/universal_ctrl_chans_demapper_impl.cc21
2 files changed, 33 insertions, 16 deletions
diff --git a/lib/demapping/tch_f_chans_demapper_impl.cc b/lib/demapping/tch_f_chans_demapper_impl.cc
index cc24b9e..a54ed3f 100644
--- a/lib/demapping/tch_f_chans_demapper_impl.cc
+++ b/lib/demapping/tch_f_chans_demapper_impl.cc
@@ -29,6 +29,8 @@
#include <grgsm/endian.h>
#include <grgsm/gsmtap.h>
+#define BURST_SIZE 148
+
namespace gr {
namespace gsm {
@@ -80,12 +82,20 @@ namespace gr {
int8_t * burst_bits = (int8_t *)(pmt::blob_data(header_plus_burst))+sizeof(gsmtap_hdr);
if(header->timeslot == d_timeslot){
- header->sub_type = GSMTAP_CHANNEL_TCH_F;
+ int8_t new_msg[sizeof(gsmtap_hdr)+BURST_SIZE];
+ gsmtap_hdr * new_hdr = (gsmtap_hdr*)new_msg;
+ memcpy(new_msg, header, sizeof(gsmtap_hdr)+BURST_SIZE);
+ new_hdr->sub_type = GSMTAP_CHANNEL_TCH_F;
if (fn_mod13 == 12)
- {
header->sub_type = GSMTAP_CHANNEL_ACCH|GSMTAP_CHANNEL_TCH_F;
+ pmt::pmt_t msg_binary_blob = pmt::make_blob(new_msg,sizeof(gsmtap_hdr)+BURST_SIZE);
+ pmt::pmt_t msg_out = pmt::cons(pmt::PMT_NIL, msg_binary_blob);
+
+
+ if (fn_mod13 == 12)
+ {
// position of SACCH burst based on timeslot
// see specification gsm 05.02
uint32_t index;
@@ -104,7 +114,7 @@ namespace gr {
if (is_sacch)
{
- d_bursts_sacch[index] = msg;
+ d_bursts_sacch[index] = msg_out;
d_frame_numbers_sacch[index] = frame_nr;
if (index == 3)
@@ -135,8 +145,8 @@ namespace gr {
if (fn_mod13 <= 3)
{
// add to b1 and b3
- d_bursts[0][fn_mod13] = msg;
- d_bursts[2][fn_mod13 + 4] = msg;
+ d_bursts[0][fn_mod13] = msg_out;
+ d_bursts[2][fn_mod13 + 4] = msg_out;
// set framenumber
d_frame_numbers[0][fn_mod13] = frame_nr;
@@ -145,8 +155,8 @@ namespace gr {
else if (fn_mod13 >= 4 && fn_mod13 <= 7)
{
// add to b1 and b2
- d_bursts[0][fn_mod13] = msg;
- d_bursts[1][fn_mod13 - 4] = msg;
+ d_bursts[0][fn_mod13] = msg_out;
+ d_bursts[1][fn_mod13 - 4] = msg_out;
// set framenumber
d_frame_numbers[0][fn_mod13] = frame_nr;
@@ -155,8 +165,8 @@ namespace gr {
else if (fn_mod13 >= 8 && fn_mod13 <= 11)
{
// add to b2 and b3
- d_bursts[1][fn_mod13 - 4] = msg;
- d_bursts[2][fn_mod13 - 8] = msg;
+ d_bursts[1][fn_mod13 - 4] = msg_out;
+ d_bursts[2][fn_mod13 - 8] = msg_out;
// set framenumber
d_frame_numbers[1][fn_mod13 - 4] = frame_nr;
diff --git a/lib/demapping/universal_ctrl_chans_demapper_impl.cc b/lib/demapping/universal_ctrl_chans_demapper_impl.cc
index 85cb0c6..cbbbc32 100644
--- a/lib/demapping/universal_ctrl_chans_demapper_impl.cc
+++ b/lib/demapping/universal_ctrl_chans_demapper_impl.cc
@@ -30,6 +30,8 @@
#include <grgsm/gsmtap.h>
#include <set>
+#define BURST_SIZE 148
+
namespace gr {
namespace gsm {
@@ -209,6 +211,12 @@ namespace gr {
bool uplink_burst = (be16toh(header->arfcn) & 0x4000) ? true : false;
if(header->timeslot==d_timeslot){
+ int8_t new_msg[sizeof(gsmtap_hdr)+BURST_SIZE];
+ gsmtap_hdr * new_hdr = (gsmtap_hdr*)new_msg;
+ memcpy(new_msg, header, sizeof(gsmtap_hdr)+BURST_SIZE);
+ pmt::pmt_t msg_binary_blob = pmt::make_blob(new_msg,sizeof(gsmtap_hdr)+BURST_SIZE);
+ pmt::pmt_t msg_out = pmt::cons(pmt::PMT_NIL, msg_binary_blob);
+
if(uplink_burst)
{
uint32_t fn51_start = d_uplink_starts_fn_mod51[fn_mod51];
@@ -217,15 +225,15 @@ namespace gr {
if(ch_type != 0)
{
- header->sub_type = ch_type;
+ new_hdr->sub_type = ch_type;
}
- header->sub_slot = d_uplink_subslots[fn_mod51 + (51 * (frame_nr % 2))];
+ new_hdr->sub_slot = d_uplink_subslots[fn_mod51 + (51 * (frame_nr % 2))];
if(fn_mod51>=fn51_start && fn_mod51<=fn51_stop)
{
uint32_t ii = fn_mod51 - fn51_start;
d_uplink_frame_numbers[ii] = frame_nr;
- d_uplink_bursts[ii] = msg;
+ d_uplink_bursts[ii] = msg_out;
}
if(fn_mod51==fn51_stop)
@@ -258,15 +266,15 @@ namespace gr {
if(ch_type != 0)
{
- header->sub_type = ch_type;
+ new_hdr->sub_type = ch_type;
}
- header->sub_slot = d_downlink_subslots[fn_mod51 + (51 * (frame_nr % 2))];
+ new_hdr->sub_slot = d_downlink_subslots[fn_mod51 + (51 * (frame_nr % 2))];
if(fn_mod51>=fn51_start && fn_mod51<=fn51_stop)
{
uint32_t ii = fn_mod51 - fn51_start;
d_downlink_frame_numbers[ii] = frame_nr;
- d_downlink_bursts[ii] = msg;
+ d_downlink_bursts[ii] = msg_out;
}
if(fn_mod51==fn51_stop)
@@ -295,4 +303,3 @@ namespace gr {
}
} /* namespace gsm */
} /* namespace gr */
-