summaryrefslogtreecommitdiff
path: root/include/mts/MTS_IO_CellularRadio.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/mts/MTS_IO_CellularRadio.h')
-rw-r--r--include/mts/MTS_IO_CellularRadio.h87
1 files changed, 87 insertions, 0 deletions
diff --git a/include/mts/MTS_IO_CellularRadio.h b/include/mts/MTS_IO_CellularRadio.h
index 07daf19..71190c5 100644
--- a/include/mts/MTS_IO_CellularRadio.h
+++ b/include/mts/MTS_IO_CellularRadio.h
@@ -39,6 +39,61 @@
#include <vector>
#include <functional>
+typedef struct
+{
+ const char *name;
+ int32_t low;
+ int32_t high;
+} *pNameRangeMap, nameRangeMap;
+
+static const unsigned int NUM_GSM_BANDS = 7;
+static const unsigned int NUM_WCDMA_BANDS = 6;
+static const unsigned int NUM_LTE_BANDS = 42;
+
+// http://niviuk.free.fr/gsm_band.php
+static const nameRangeMap GSMband[] =
+{
+ {"GSM 450", 259, 293}, {"GSM 480", 306, 340},
+ {"GSM 750", 438, 511}, {"GSM 850", 128, 251},
+ {"GSM 900 P", 1, 124}, {"GSM 900 E/R", 955, 1023},
+ {"GSM DCS 1800/1900", 512, 885},
+
+};
+
+// http://niviuk.free.fr/umts_band.php
+static const nameRangeMap WCDMAband[] =
+{
+ {"BAND I", 10592, 10838}, {"BAND II", 9662, 9938},
+ {"BAND III", 1162, 1513}, {"BAND IV", 1537, 1738},
+ {"BAND V", 4357, 4458}, {"BAND VI", 4387, 4413}
+};
+
+// http://niviuk.free.fr/lte_band.php
+static const nameRangeMap EULTRAband[] =
+{
+ {"EUTRAN BAND1", 0, 599}, {"EUTRAN BAND2", 600, 1199},
+ {"EUTRAN BAND3", 1200, 1949}, {"EUTRAN BAND4", 1950, 2399},
+ {"EUTRAN BAND5", 2400, 2649}, {"EUTRAN BAND6", 2650, 2749},
+ {"EUTRAN BAND7", 2750, 3449}, {"EUTRAN BAND8", 3450, 3799},
+ {"EUTRAN BAND9", 3800, 4149}, {"EUTRAN BAND10", 4150, 4749},
+ {"EUTRAN BAND11", 4750, 4999}, {"EUTRAN BAND12", 5000, 5179},
+ {"EUTRAN BAND13", 5180, 5279}, {"EUTRAN BAND14", 5280, 5379},
+ {"EUTRAN BAND17", 5730, 5849}, {"EUTRAN BAND18", 5850, 5999},
+ {"EUTRAN BAND19", 6000, 6149}, {"EUTRAN BAND20", 6150, 6449},
+ {"EUTRAN BAND21", 6450, 6525}, {"EUTRAN BAND22", 6600, 7399},
+ {"EUTRAN BAND23", 7500, 7699}, {"EUTRAN BAND24", 7700, 8039},
+ {"EUTRAN BAND25", 8040, 8689}, {"EUTRAN BAND26", 8690, 9039},
+ {"EUTRAN BAND27", 9040, 9209}, {"EUTRAN BAND28", 9210, 9659},
+ {"EUTRAN BAND29", 9660, 9769}, {"EUTRAN BAND30", 9770, 9869},
+ {"EUTRAN BAND31", 9870, 9919}, {"EUTRAN BAND32", 9920, 10359},
+ {"EUTRAN BAND33", 36000, 36199}, {"EUTRAN BAND34", 36200, 36349},
+ {"EUTRAN BAND35", 36350, 36949}, {"EUTRAN BAND36", 36950, 37549},
+ {"EUTRAN BAND37", 37550, 37749}, {"EUTRAN BAND38", 37750, 38249},
+ {"EUTRAN BAND39", 38250, 38649}, {"EUTRAN BAND40", 38650, 39649},
+ {"EUTRAN BAND41", 39650, 41589}, {"EUTRAN BAND42", 41590, 43589},
+ {"EUTRAN BAND43", 43590, 45589}, {"EUTRAN BAND44", 45590, 46589}
+};
+
namespace MTS {
namespace IO {
@@ -415,6 +470,38 @@ namespace MTS {
private:
+ class RadioBandMap : NonCopyable {
+ public:
+ RadioBandMap()
+ {
+ m_sChannel = CellularRadio::VALUE_UNKNOWN;
+ m_iChannel = 0;
+ m_sRadioType = CellularRadio::VALUE_UNKNOWN;
+ }
+
+ RadioBandMap(const std::string &channel, const std::string &radioType) :
+ m_sChannel(channel),
+ m_sRadioType(radioType)
+ {
+ m_iChannel = strtol(m_sChannel.c_str(), NULL, 10);
+ }
+
+ virtual ~RadioBandMap() {}
+
+ const char *getRadioBandName();
+ const char *getRadioBandName(const std::string &channel, const std::string &radioType);
+
+ private:
+
+ const char *getLTEBand(const int channel);
+ const char *getCDMABand(const int channel);
+ const char *getGSMBand(const int channel);
+
+ std::string m_sChannel;
+ int m_iChannel;
+ std::string m_sRadioType;
+ };
+
std::string m_sName;
std::string m_sRadioPort;
std::string m_sFirmware;