GNU Radio's LTE Package
mib_unpack_vbm_impl.h
Go to the documentation of this file.
1/* -*- c++ -*- */
2/*
3 * Copyright 2013 Communications Engineering Lab (CEL) / Karlsruhe Institute of Technology (KIT)
4 *
5 * This is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3, or (at your option)
8 * any later version.
9 *
10 * This software is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this software; see the file COPYING. If not, write to
17 * the Free Software Foundation, Inc., 51 Franklin Street,
18 * Boston, MA 02110-1301, USA.
19 */
20
21#ifndef INCLUDED_LTE_MIB_UNPACK_VBM_IMPL_H
22#define INCLUDED_LTE_MIB_UNPACK_VBM_IMPL_H
23
24#include <lte/mib_unpack_vbm.h>
25#include <cstdio>
26#include <boost/format.hpp>
27
28namespace gr {
29 namespace lte {
30
32 int N_ant;
36 std::string get_values_string(){
37 return (boost::format("(N_ant=%i N_rb_dl=%i PHICH: dur=%i res=%1.2f)") % N_ant % N_rb_dl % phich_duration % phich_resources).str();
38 //printf("(N_ant=%i ", N_ant);
39 //printf("N_rb_dl=%i ", N_rb_dl);
40 //printf("PHICH: dur=%i res=%1.2f)\n", phich_duration, phich_resources);
41 }
42 };
43
45 {
46 private:
47 cell_state_information d_state_info;
48 int d_SFN;
49 int d_unchanged_decodings;
50 int d_sfn_counter;
51
52 pmt::pmt_t d_port_N_ant;
53 pmt::pmt_t d_port_N_rb_dl;
54 pmt::pmt_t d_port_phich_duration;
55 pmt::pmt_t d_port_phich_resources;
56 pmt::pmt_t d_port_SFN;
57
58 std::vector<int> d_SFN_vec;
59 int d_work_calls;
60
61 //private methods
62 void decode_mib(char* mib);
63 bool decode_state_mib(char* mib);
64 int decode_N_rb_dl(char* mib);
65 float decode_phich_resources(char* mib);
66 int decode_sfn(char* mib);
67 int extract_sfn_lsb_from_tag();
68
69 void send_mib();
70 void send_state_mib();
71 void send_sfn();
72
73 public:
74 mib_unpack_vbm_impl(std::string& name);
76
77 // Where all the action really happens
78 int work(int noutput_items,
79 gr_vector_const_void_star &input_items,
80 gr_vector_void_star &output_items);
81
82 int get_SFN (){return d_SFN;}
83 std::vector<int> get_SFN_vec(){return d_SFN_vec;}
84 int get_N_ant (){return d_state_info.N_ant;}
85 int get_N_rb_dl (){return d_state_info.N_rb_dl;}
86 int get_phich_dur (){return d_state_info.phich_duration;}
87 float get_phich_res (){return d_state_info.phich_resources;}
89 };
90
91 } // namespace lte
92} // namespace gr
93
94#endif /* INCLUDED_LTE_MIB_UNPACK_VBM_IMPL_H */
95
Definition: mib_unpack_vbm_impl.h:45
mib_unpack_vbm_impl(std::string &name)
int get_N_rb_dl()
Definition: mib_unpack_vbm_impl.h:85
int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
std::vector< int > get_SFN_vec()
Definition: mib_unpack_vbm_impl.h:83
int get_phich_dur()
Definition: mib_unpack_vbm_impl.h:86
float get_phich_res()
Definition: mib_unpack_vbm_impl.h:87
int get_SFN()
Definition: mib_unpack_vbm_impl.h:82
int get_N_ant()
Definition: mib_unpack_vbm_impl.h:84
Block unpacks MIB and publishes the parameters as messages.
Definition: mib_unpack_vbm.h:37
Definition: bch_crc_check_ant_chooser_bb.h:28
Definition: mib_unpack_vbm_impl.h:31
int N_rb_dl
Definition: mib_unpack_vbm_impl.h:33
int phich_duration
Definition: mib_unpack_vbm_impl.h:34
std::string get_values_string()
Definition: mib_unpack_vbm_impl.h:36
float phich_resources
Definition: mib_unpack_vbm_impl.h:35
int N_ant
Definition: mib_unpack_vbm_impl.h:32