aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorpiotr <Piotr Krysik pkrysik@elka.pw.edu.pl>2014-08-04 11:22:47 +0200
committerpiotr <Piotr Krysik pkrysik@elka.pw.edu.pl>2014-08-04 11:22:47 +0200
commitdf3045902802dfb80f73e0a0adabf2f36c1c241a (patch)
tree74b602df0b2c2ed70735da4f2cf71ec0fdc793ac /lib
parentc00ce9c7b508301812b28a92bc39f4a34d02c924 (diff)
Added option to the simple mapper
Diffstat (limited to 'lib')
-rw-r--r--lib/demapping/get_bcch_or_ccch_bursts_impl.cc16
-rw-r--r--lib/demapping/get_bcch_or_ccch_bursts_impl.h3
2 files changed, 10 insertions, 9 deletions
diff --git a/lib/demapping/get_bcch_or_ccch_bursts_impl.cc b/lib/demapping/get_bcch_or_ccch_bursts_impl.cc
index 4e8d369..011811d 100644
--- a/lib/demapping/get_bcch_or_ccch_bursts_impl.cc
+++ b/lib/demapping/get_bcch_or_ccch_bursts_impl.cc
@@ -30,19 +30,20 @@ namespace gr {
namespace gsm {
get_bcch_or_ccch_bursts::sptr
- get_bcch_or_ccch_bursts::make()
+ get_bcch_or_ccch_bursts::make(unsigned int fn51_start)
{
return gnuradio::get_initial_sptr
- (new get_bcch_or_ccch_bursts_impl());
+ (new get_bcch_or_ccch_bursts_impl(fn51_start));
}
/*
* The private constructor
*/
- get_bcch_or_ccch_bursts_impl::get_bcch_or_ccch_bursts_impl()
+ get_bcch_or_ccch_bursts_impl::get_bcch_or_ccch_bursts_impl(unsigned int fn51_start)
: gr::block("get_bcch_or_ccch_bursts",
gr::io_signature::make(0, 0, 0),
- gr::io_signature::make(0, 0, 0))
+ gr::io_signature::make(0, 0, 0)),
+ d_fn51_start(fn51_start)
{
message_port_register_in(pmt::mp("bursts"));
set_msg_handler(pmt::mp("bursts"), boost::bind(&get_bcch_or_ccch_bursts_impl::filter_ccch, this, _1));
@@ -64,12 +65,11 @@ namespace gr {
uint32_t frame_nr = header->frame_number;
uint32_t fn_mod51 = header->frame_number % 51;
- const int fn51_start = 6;
- const int fn51_stop = 9;
+ int fn51_stop = d_fn51_start+3;
if(header->timeslot==0){
- if(fn_mod51>=fn51_start && fn_mod51<=fn51_stop){
- uint32_t ii = fn_mod51-fn51_start;
+ if(fn_mod51>=d_fn51_start && fn_mod51<=fn51_stop){
+ uint32_t ii = fn_mod51-d_fn51_start;
d_frame_numbers[ii]=header->frame_number;
d_bursts[ii] = msg;
}
diff --git a/lib/demapping/get_bcch_or_ccch_bursts_impl.h b/lib/demapping/get_bcch_or_ccch_bursts_impl.h
index c3c4c59..73cfb52 100644
--- a/lib/demapping/get_bcch_or_ccch_bursts_impl.h
+++ b/lib/demapping/get_bcch_or_ccch_bursts_impl.h
@@ -29,10 +29,11 @@ namespace gr {
class get_bcch_or_ccch_bursts_impl : public get_bcch_or_ccch_bursts
{
private:
+ unsigned int d_fn51_start;
uint32_t d_frame_numbers[4];
pmt::pmt_t d_bursts[4];
public:
- get_bcch_or_ccch_bursts_impl();
+ get_bcch_or_ccch_bursts_impl(unsigned int fn51_start);
~get_bcch_or_ccch_bursts_impl();
void filter_ccch(pmt::pmt_t msg);
};