summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSerhii Kostiuk <serhii.o.kostiuk@globallogic.com>2019-07-18 11:59:02 +0300
committerSerhii Kostiuk <serhii.o.kostiuk@globallogic.com>2019-07-18 12:16:25 +0300
commitfe970f5bb77354b7507e230b1465e9178c80ee7a (patch)
treed7a840d51a65ecface536ced0c21062f4804ee98
parentebfa95037a98d785029dc9afe8e4aafd8c81b843 (diff)
downloadlibmts-io-fe970f5bb77354b7507e230b1465e9178c80ee7a.tar.gz
libmts-io-fe970f5bb77354b7507e230b1465e9178c80ee7a.tar.bz2
libmts-io-fe970f5bb77354b7507e230b1465e9178c80ee7a.zip
[MTS-MTQ] QuectelRadio implementation
Refactored the CellularRadio class to include base stub implementation for the "CellularRadio::getCarrierFromFirmware" and "CellularRadio::getHardwareVersionFromFirmware" methods. From now assuming that those two possibilities are not supported by the modem until otherwise specified (i.e. until the method implementation was overridden in derived class). This change was implemented after a code review.
-rw-r--r--include/mts/MTS_IO_CellularRadio.h4
-rw-r--r--include/mts/MTS_IO_QuectelRadio.h3
-rw-r--r--src/MTS_IO_CellularRadio.cpp12
-rw-r--r--src/MTS_IO_QuectelRadio.cpp17
4 files changed, 14 insertions, 22 deletions
diff --git a/include/mts/MTS_IO_CellularRadio.h b/include/mts/MTS_IO_CellularRadio.h
index 9866d73..eecefee 100644
--- a/include/mts/MTS_IO_CellularRadio.h
+++ b/include/mts/MTS_IO_CellularRadio.h
@@ -121,8 +121,8 @@ namespace MTS {
CellularRadio(const std::string& sName, const std::string& sRadioPort);
- virtual bool getCarrierFromFirmware(const std::string& sFirmware, std::string& sCarrier) = 0;
- virtual bool getHardwareVersionFromFirmware(const std::string& sFirmware, std::string& sHardware) = 0;
+ virtual bool getCarrierFromFirmware(const std::string& sFirmware, std::string& sCarrier);
+ virtual bool getHardwareVersionFromFirmware(const std::string& sFirmware, std::string& sHardware);
virtual void getCommonNetworkStats(Json::Value& jData);
diff --git a/include/mts/MTS_IO_QuectelRadio.h b/include/mts/MTS_IO_QuectelRadio.h
index 557fd82..3b1ba5a 100644
--- a/include/mts/MTS_IO_QuectelRadio.h
+++ b/include/mts/MTS_IO_QuectelRadio.h
@@ -47,9 +47,6 @@ namespace MTS {
protected:
QuectelRadio(const std::string& sName, const std::string& sRadioPort);
- bool getCarrierFromFirmware(const std::string& sFirmware, std::string& sCarrier) override;
- bool getHardwareVersionFromFirmware(const std::string& sFirmware, std::string& sHardware) override;
-
CODE getIsSimInserted(bool& bData) override;
CODE getSimLockAttempts(int& iAttemptsPin, int& iAttemptsPuk) override;
diff --git a/src/MTS_IO_CellularRadio.cpp b/src/MTS_IO_CellularRadio.cpp
index 4dcea7d..feccd3c 100644
--- a/src/MTS_IO_CellularRadio.cpp
+++ b/src/MTS_IO_CellularRadio.cpp
@@ -976,6 +976,18 @@ bool CellularRadio::splitAndAssign(const std::string& sLine, const std::string&
return true;
}
+bool CellularRadio::getCarrierFromFirmware(const std::string& sFirmware, std::string& sCarrier) {
+ // Assuming that this function is not supported by the modem until overriden.
+
+ return false;
+}
+
+bool CellularRadio::getHardwareVersionFromFirmware(const std::string& sFirmware, std::string& sHardware) {
+ // Assuming that this function is not supported by the modem until overriden.
+
+ return false;
+}
+
const char *CellularRadio::RadioBandMap::getLTEBand(const int32_t channel)
{
for (unsigned int ii = 0; ii < NUM_LTE_BANDS; ii++)
diff --git a/src/MTS_IO_QuectelRadio.cpp b/src/MTS_IO_QuectelRadio.cpp
index 4d13e7b..0712788 100644
--- a/src/MTS_IO_QuectelRadio.cpp
+++ b/src/MTS_IO_QuectelRadio.cpp
@@ -470,23 +470,6 @@ CellularRadio::CODE QuectelRadio::getServiceDomain(ICellularRadio::SERVICEDOMAIN
return SUCCESS;
}
-bool QuectelRadio::getCarrierFromFirmware(const std::string& sFirmware, std::string& sCarrier) {
- // TODO: Implement properly if needed
- // This function is used only in CdmaRadio implementation but was defined in
- // the CellularRadio class before refactoring.
-
- // Find out if and how we can determine the operator by firmware version.
-
- return false;
-}
-
-bool QuectelRadio::getHardwareVersionFromFirmware(const std::string& sFirmware, std::string& sHardware) {
- // TODO: Implement properly
- // Find out if and how we can extract the hardware version from firmware version on Quectel devices
-
- return false;
-}
-
CellularRadio::CODE QuectelRadio::getIsSimInserted(bool& bData) {
printTrace("%s| Get SIM insertion status", getName().c_str());