burst_sdcch_subslot_filter: implement and expose GET/SET API

This commit is contained in:
Vadim Yanitskiy 2017-07-21 07:18:05 +07:00
parent ccc7183e42
commit fbfd836fc2
3 changed files with 46 additions and 0 deletions

View File

@ -54,6 +54,13 @@ namespace gr {
* creating new instances.
*/
static sptr make(subslot_filter_mode mode, unsigned int subslot);
/* External API */
virtual unsigned int get_ss(void) = 0;
virtual unsigned int set_ss(unsigned int ss) = 0;
virtual subslot_filter_mode get_mode(void) = 0;
virtual subslot_filter_mode set_mode(subslot_filter_mode mode) = 0;
};
} // namespace gsm
} // namespace gr

View File

@ -101,5 +101,37 @@ namespace gr {
message_port_pub(pmt::mp("out"), msg);
}
}
/* External API */
unsigned int
burst_sdcch_subslot_filter_impl::get_ss(void)
{
return d_subslot;
}
unsigned int
burst_sdcch_subslot_filter_impl::set_ss(unsigned int ss)
{
if ((d_mode == SS_FILTER_SDCCH8 && ss < 8)
|| (d_mode == SS_FILTER_SDCCH4 && ss < 4))
d_subslot = ss;
return d_subslot;
}
subslot_filter_mode
burst_sdcch_subslot_filter_impl::get_mode(void)
{
return d_mode;
}
subslot_filter_mode
burst_sdcch_subslot_filter_impl::set_mode(subslot_filter_mode mode)
{
d_mode = mode;
return d_mode;
}
} /* namespace gsm */
} /* namespace gr */

View File

@ -37,6 +37,13 @@ namespace gr {
burst_sdcch_subslot_filter_impl(subslot_filter_mode mode, unsigned int subslot);
~burst_sdcch_subslot_filter_impl();
void process_burst(pmt::pmt_t msg);
/* External API */
unsigned int get_ss(void);
unsigned int set_ss(unsigned int ss);
subslot_filter_mode get_mode(void);
subslot_filter_mode set_mode(subslot_filter_mode mode);
};
} // namespace gsm