diff options
author | Vadim Yanitskiy <axilirator@gmail.com> | 2017-07-21 06:39:40 +0700 |
---|---|---|
committer | Vadim Yanitskiy <axilirator@gmail.com> | 2017-07-21 07:04:30 +0700 |
commit | 91195eb5bfdf124b7dfaabfeae552b8050738aca (patch) | |
tree | a06ea55830e1931c8f8af9e4bbfc43e88a9889b0 | |
parent | 5eb5db2fc1f4ac2ddfcdb81fc2351b629517ca3a (diff) |
burst_timeslot_filter: implement and expose GET/SET API
-rw-r--r-- | include/grgsm/flow_control/burst_timeslot_filter.h | 4 | ||||
-rw-r--r-- | lib/flow_control/burst_timeslot_filter_impl.cc | 19 | ||||
-rw-r--r-- | lib/flow_control/burst_timeslot_filter_impl.h | 4 |
3 files changed, 27 insertions, 0 deletions
diff --git a/include/grgsm/flow_control/burst_timeslot_filter.h b/include/grgsm/flow_control/burst_timeslot_filter.h index f23fcf7..2f16b77 100644 --- a/include/grgsm/flow_control/burst_timeslot_filter.h +++ b/include/grgsm/flow_control/burst_timeslot_filter.h @@ -48,6 +48,10 @@ namespace gr { * creating new instances. */ static sptr make(unsigned int timeslot); + + /* External API */ + virtual unsigned int get_tn(void) = 0; + virtual unsigned int set_tn(unsigned int tn) = 0; }; } // namespace gsm } // namespace gr diff --git a/lib/flow_control/burst_timeslot_filter_impl.cc b/lib/flow_control/burst_timeslot_filter_impl.cc index ccf4d4c..20306d1 100644 --- a/lib/flow_control/burst_timeslot_filter_impl.cc +++ b/lib/flow_control/burst_timeslot_filter_impl.cc @@ -73,5 +73,24 @@ namespace gr { message_port_pub(pmt::mp("out"), msg); } } + + /* + * External API + */ + unsigned int + burst_timeslot_filter_impl::get_tn(void) + { + return d_timeslot; + } + + unsigned int + burst_timeslot_filter_impl::set_tn(unsigned int tn) + { + if (tn < 8) + d_timeslot = tn; + + return d_timeslot; + } + } /* namespace gsm */ } /* namespace gr */ diff --git a/lib/flow_control/burst_timeslot_filter_impl.h b/lib/flow_control/burst_timeslot_filter_impl.h index f7b0b2d..130047e 100644 --- a/lib/flow_control/burst_timeslot_filter_impl.h +++ b/lib/flow_control/burst_timeslot_filter_impl.h @@ -36,6 +36,10 @@ namespace gr { burst_timeslot_filter_impl(unsigned int timeslot); ~burst_timeslot_filter_impl(); void process_burst(pmt::pmt_t msg); + + /* External API */ + unsigned int get_tn(void); + unsigned int set_tn(unsigned int tn); }; } // namespace gsm |