SDRAngel  4.11.5
Developer docs for <a href="https://github.com/f4exb/sdrangel">SDRangel<\a>, an Open Source Qt5 / OpenGL 3.0+ SDR and signal analyzer frontend to various hardware.
devicehackrfvalues.cpp
Go to the documentation of this file.
1 // Copyright (C) 2017 Edouard Griffiths, F4EXB //
3 // //
4 // This program is free software; you can redistribute it and/or modify //
5 // it under the terms of the GNU General Public License as published by //
6 // the Free Software Foundation as version 3 of the License, or //
7 // (at your option) any later version. //
8 // //
9 // This program is distributed in the hope that it will be useful, //
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of //
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
12 // GNU General Public License V3 for more details. //
13 // //
14 // You should have received a copy of the GNU General Public License //
15 // along with this program. If not, see <http://www.gnu.org/licenses/>. //
17 
18 #include "devicehackrfvalues.h"
19 
20 const unsigned int HackRFBandwidths::m_nb_bw = 16;
22  1750,
23  2500,
24  3500,
25  5000,
26  5500,
27  6000,
28  7000,
29  8000,
30  9000,
31  10000,
32  12000,
33  14000,
34  15000,
35  20000,
36  24000,
37  28000};
38 
39 unsigned int HackRFBandwidths::getBandwidth(unsigned int bandwidth_index)
40 {
41  if (bandwidth_index < m_nb_bw)
42  {
43  return m_bw_k[bandwidth_index];
44  }
45  else
46  {
47  return m_bw_k[0];
48  }
49 }
50 
51 unsigned int HackRFBandwidths::getBandwidthIndex(unsigned int bandwidth)
52 {
53  for (unsigned int i=0; i < m_nb_bw; i++)
54  {
55  if (bandwidth == m_bw_k[i])
56  {
57  return i;
58  }
59  }
60 
61  return 0;
62 }
63 
64 
static const unsigned int m_nb_bw
static const unsigned int m_bw_k[]
int32_t i
Definition: decimators.h:244
static unsigned int getBandwidth(unsigned int bandwidth_index)
static unsigned int getBandwidthIndex(unsigned int bandwidth)