From e571e96518aaedbbb858c6c2b0ad536ea62722c6 Mon Sep 17 00:00:00 2001 From: Roman Khassraf Date: Sun, 12 Apr 2015 15:35:41 +0200 Subject: Added subslot assignment to frames, which enables filtering by subslot in e.g. wireshark --- .../universal_ctrl_chans_demapper_impl.cc | 45 ++++++++++++++++++++++ lib/demapping/universal_ctrl_chans_demapper_impl.h | 1 + 2 files changed, 46 insertions(+) (limited to 'lib/demapping') diff --git a/lib/demapping/universal_ctrl_chans_demapper_impl.cc b/lib/demapping/universal_ctrl_chans_demapper_impl.cc index 403167f..c9e461a 100644 --- a/lib/demapping/universal_ctrl_chans_demapper_impl.cc +++ b/lib/demapping/universal_ctrl_chans_demapper_impl.cc @@ -55,6 +55,8 @@ namespace gr { { d_starts_fn_mod51[ii]=0; d_channel_types[ii]=0; + d_subslots[ii] = 0; + d_subslots[ii+51] = 0; } std::vector::const_iterator s; @@ -78,6 +80,48 @@ namespace gr { } } + std::set distinct_channels(channel_types.begin(), channel_types.end()); + std::set::iterator it; + unsigned int subslot; + + for (it=distinct_channels.begin(); it != distinct_channels.end(); it++) + { + subslot = 0; + for(s=starts_fn_mod51.begin();s != starts_fn_mod51.end(); s++) + { + if ((d_channel_types[*s] == *it) and (*s >= 0) and (*s <= (51-4))) + { + for(int ii=0; ii<4; ii++) + { + d_subslots[*s+ii] = subslot; + d_subslots[*s+ii+51] = subslot; + } + subslot++; + } + } + + if (*it == GSMTAP_CHANNEL_ACCH or + *it == (GSMTAP_CHANNEL_ACCH|GSMTAP_CHANNEL_SDCCH) or + *it == (GSMTAP_CHANNEL_ACCH|GSMTAP_CHANNEL_SDCCH4) or + *it == (GSMTAP_CHANNEL_ACCH|GSMTAP_CHANNEL_SDCCH8) or + *it == (GSMTAP_CHANNEL_ACCH|GSMTAP_CHANNEL_TCH_F) or + *it == (GSMTAP_CHANNEL_ACCH|GSMTAP_CHANNEL_TCH_H) + ) + { + for(s=starts_fn_mod51.begin();s != starts_fn_mod51.end(); s++) + { + if ((d_channel_types[*s] == *it) and (*s >= 0) and (*s <= (51-4))) + { + for(int ii=0; ii<4; ii++) + { + d_subslots[*s+ii+51] = subslot; + } + subslot++; + } + } + } + } + message_port_register_in(pmt::mp("bursts")); set_msg_handler(pmt::mp("bursts"), boost::bind(&universal_ctrl_chans_demapper_impl::filter_ctrl_chans, this, _1)); @@ -104,6 +148,7 @@ namespace gr { if(header->timeslot==d_timeslot){ header->sub_type = ch_type; + header->sub_slot = d_subslots[fn_mod51 + (51 * (frame_nr % 2))]; if(fn_mod51>=fn51_start && fn_mod51<=fn51_stop) { diff --git a/lib/demapping/universal_ctrl_chans_demapper_impl.h b/lib/demapping/universal_ctrl_chans_demapper_impl.h index aade90d..67e917e 100644 --- a/lib/demapping/universal_ctrl_chans_demapper_impl.h +++ b/lib/demapping/universal_ctrl_chans_demapper_impl.h @@ -33,6 +33,7 @@ namespace gr { private: unsigned int d_starts_fn_mod51[51]; unsigned int d_channel_types[51]; + unsigned int d_subslots[102]; unsigned int d_timeslot; uint32_t d_frame_numbers[4]; pmt::pmt_t d_bursts[4]; -- cgit v1.2.3