From 39006c5502e67f4a5c5823c450064b69b7a15ecf Mon Sep 17 00:00:00 2001 From: f4exb Date: Sat, 18 Feb 2017 11:42:58 +0100 Subject: [PATCH] HackRF support: added 4.333 MS/s rate for GSM --- devices/hackrf/devicehackrfvalues.cpp | 7 +++++-- devices/hackrf/devicehackrfvalues.h | 8 ++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/devices/hackrf/devicehackrfvalues.cpp b/devices/hackrf/devicehackrfvalues.cpp index 9ae52aa9c..5b62be265 100644 --- a/devices/hackrf/devicehackrfvalues.cpp +++ b/devices/hackrf/devicehackrfvalues.cpp @@ -16,10 +16,12 @@ #include "devicehackrfvalues.h" -unsigned int HackRFSampleRates::m_rates[] = { +const unsigned int HackRFSampleRates::m_nb_rates = 16; +const unsigned int HackRFSampleRates::m_rates[HackRFSampleRates::m_nb_rates] = { 2400000, 3200000, 4000000, + 4333333, // for GSM 4800000, 5600000, 6000000, @@ -58,7 +60,8 @@ unsigned int HackRFSampleRates::getRateIndex(unsigned int rate) return 0; } -unsigned int HackRFBandwidths::m_bw_k[] = { +const unsigned int HackRFBandwidths::m_nb_bw = 16; +const unsigned int HackRFBandwidths::m_bw_k[HackRFBandwidths::m_nb_bw] = { 1750, 2500, 3500, diff --git a/devices/hackrf/devicehackrfvalues.h b/devices/hackrf/devicehackrfvalues.h index 0fcf64d75..fca91c691 100644 --- a/devices/hackrf/devicehackrfvalues.h +++ b/devices/hackrf/devicehackrfvalues.h @@ -21,16 +21,16 @@ class HackRFSampleRates { public: static unsigned int getRate(unsigned int rate_index); static unsigned int getRateIndex(unsigned int rate); - static const unsigned int m_nb_rates = 15; - static unsigned int m_rates[m_nb_rates]; + static const unsigned int m_nb_rates; + static const unsigned int m_rates[]; }; class HackRFBandwidths { public: static unsigned int getBandwidth(unsigned int bandwidth_index); static unsigned int getBandwidthIndex(unsigned int bandwidth); - static const unsigned int m_nb_bw = 16; - static unsigned int m_bw_k[m_nb_bw]; + static const unsigned int m_nb_bw; + static const unsigned int m_bw_k[]; }; #endif /* DEVICES_HACKRF_DEVICEHACKRFVALUES_H_ */