diff options
| author | David Marcaccini <david.marcaccini@multitech.com> | 2019-03-08 13:19:52 -0600 | 
|---|---|---|
| committer | David Marcaccini <david.marcaccini@multitech.com> | 2019-03-08 13:19:52 -0600 | 
| commit | 36d1c638d115caefc042fe7a172cc531bb9e1436 (patch) | |
| tree | a79037887a483039e9c347d213c519dc52706465 /src | |
| parent | 4df85d1a64ded69f1ddd6c4c26e4f52773605c4a (diff) | |
| download | libmts-io-36d1c638d115caefc042fe7a172cc531bb9e1436.tar.gz libmts-io-36d1c638d115caefc042fe7a172cc531bb9e1436.tar.bz2 libmts-io-36d1c638d115caefc042fe7a172cc531bb9e1436.zip | |
Add support for the ME910C1-WW Radio1.0.15
Diffstat (limited to 'src')
| -rw-r--r-- | src/MTS_IO_CellularRadio.cpp | 8 | ||||
| -rw-r--r-- | src/MTS_IO_CellularRadioFactory.cpp | 6 | ||||
| -rw-r--r-- | src/MTS_IO_ME910C1WWRadio.cpp | 36 | ||||
| -rw-r--r-- | src/MTS_IO_ME910Radio.cpp | 9 | ||||
| -rw-r--r-- | src/MTS_IO_SerialConnection.cpp | 9 | 
5 files changed, 57 insertions, 11 deletions
| diff --git a/src/MTS_IO_CellularRadio.cpp b/src/MTS_IO_CellularRadio.cpp index 4db91cb..46cf61e 100644 --- a/src/MTS_IO_CellularRadio.cpp +++ b/src/MTS_IO_CellularRadio.cpp @@ -312,6 +312,9 @@ CellularRadio::CODE CellularRadio::convertModelToMtsShortCode(const std::string&      } else if (sModel.find("ME910C1-NV") == 0) {          sCode = "MVW1";          eCode = SUCCESS; +    } else if (sModel.find("ME910C1-WW") == 0) { +        sCode = "MNG2"; +        eCode = SUCCESS;      } else if (sModel.find("LE910-EUG") == 0) {          sCode = "LEU1";          eCode = SUCCESS; @@ -402,6 +405,9 @@ CellularRadio::CODE CellularRadio::convertModelToType(const std::string& sModel,      } else if (sModel.find("ME910C1-NV") == 0) {          sType = VALUE_TYPE_LTE;          eCode = SUCCESS; +    } else if (sModel.find("ME910C1-WW") == 0) { +        sType = VALUE_TYPE_LTE; +        eCode = SUCCESS;      } else if (sModel.find("GE910") == 0) {          sType = VALUE_TYPE_GSM;          eCode = SUCCESS; @@ -1587,6 +1593,8 @@ std::string CellularRadio::extractModelFromResult(const std::string& sResult) {          sModel = "ME910C1-NA";      } else if(sResult.find("ME910C1-NV") != std::string::npos) {          sModel = "ME910C1-NV"; +    } else if(sResult.find("ME910C1-WW") != std::string::npos) { +        sModel = "ME910C1-WW";      } else if(sResult.find("LE910-SVG") != std::string::npos) {          sModel = "LE910-SVG";      } else if(sResult.find("LE910-EUG") != std::string::npos) { diff --git a/src/MTS_IO_CellularRadioFactory.cpp b/src/MTS_IO_CellularRadioFactory.cpp index bbc2d3f..571797e 100644 --- a/src/MTS_IO_CellularRadioFactory.cpp +++ b/src/MTS_IO_CellularRadioFactory.cpp @@ -31,6 +31,7 @@  #include <mts/MTS_IO_ME910C1NARadio.h>  #include <mts/MTS_IO_ME910C1NVRadio.h>  #include <mts/MTS_IO_LE866A1JSRadio.h> +#include <mts/MTS_IO_ME910C1WWRadio.h>  #include <mts/MTS_IO_GE910Radio.h>  #include <mts/MTS_IO_CE910Radio.h>  #include <mts/MTS_IO_DE910Radio.h> @@ -50,6 +51,7 @@ CellularRadioFactory::CellularRadioFactory() {      m_mCreationMap[LE910C1APRadio::MODEL_NAME]    = &CellularRadioFactory::createLE910C1AP;      m_mCreationMap[ME910C1NARadio::MODEL_NAME]    = &CellularRadioFactory::createME910C1NA;      m_mCreationMap[ME910C1NVRadio::MODEL_NAME]    = &CellularRadioFactory::createME910C1NV; +    m_mCreationMap[ME910C1WWRadio::MODEL_NAME]    = &CellularRadioFactory::createME910C1WW;      m_mCreationMap[GE910Radio::MODEL_NAME]        = &CellularRadioFactory::createGE910;      m_mCreationMap[DE910Radio::MODEL_NAME]        = &CellularRadioFactory::createDE910;      m_mCreationMap[CE910Radio::MODEL_NAME]        = &CellularRadioFactory::createCE910; @@ -161,6 +163,10 @@ CellularRadio* CellularRadioFactory::createME910C1NV(const std::string& sPort) {      return new ME910C1NVRadio(sPort);  } +CellularRadio* CellularRadioFactory::createME910C1WW(const std::string& sPort) { +    return new ME910C1WWRadio(sPort); +} +  CellularRadio* CellularRadioFactory::createGE910(const std::string& sPort) {      return new GE910Radio(sPort);  } diff --git a/src/MTS_IO_ME910C1WWRadio.cpp b/src/MTS_IO_ME910C1WWRadio.cpp new file mode 100644 index 0000000..03cb1a4 --- /dev/null +++ b/src/MTS_IO_ME910C1WWRadio.cpp @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2019 by Multi-Tech Systems + * + * This file is part of libmts-io. + * + * libmts-io is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * libmts-io is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with libmts-io.  If not, see <http://www.gnu.org/licenses/>. + * + */ + +#include <mts/MTS_IO_ME910C1WWRadio.h> + +using namespace MTS::IO; + +const std::string ME910C1WWRadio::MODEL_NAME("ME910C1-WW"); + +ME910C1WWRadio::ME910C1WWRadio(const std::string& sPort) +: ME910Radio(MODEL_NAME, sPort) +{ + +} + +CellularRadio::CODE ME910C1WWRadio::getCarrier(std::string& sCarrier) { +    sCarrier = "AT&T"; +    return SUCCESS; +} diff --git a/src/MTS_IO_ME910Radio.cpp b/src/MTS_IO_ME910Radio.cpp index 2e46164..42796e9 100644 --- a/src/MTS_IO_ME910Radio.cpp +++ b/src/MTS_IO_ME910Radio.cpp @@ -1,5 +1,5 @@  /* - * Copyright (C) 2017 by Multi-Tech Systems + * Copyright (C) 2019 by Multi-Tech Systems   *   * This file is part of libmts-io.   * @@ -18,13 +18,6 @@   *   */ -/*!  - \file MTS_IO_ME910Radio.cpp - \brief A brief description  - - A more elaborate description -*/ -  #include <mts/MTS_Text.h>  #include <mts/MTS_Logger.h>  #include <mts/MTS_IO_ME910Radio.h> diff --git a/src/MTS_IO_SerialConnection.cpp b/src/MTS_IO_SerialConnection.cpp index 4a7923b..a9f3d6e 100644 --- a/src/MTS_IO_SerialConnection.cpp +++ b/src/MTS_IO_SerialConnection.cpp @@ -272,7 +272,8 @@ bool SerialConnection::doOpen(const int32_t& timeoutMillis) {  #else      m_iHandle = ::open(m_sPortName.c_str(), O_RDWR | O_NOCTTY );      if (m_iHandle == -1) { -        printWarning("SERIAL| Failed to open port [%s] [%d]", m_sPortName.c_str(), errno); +        printWarning("SERIAL| Failed to open port [%s] [%d]%s", m_sPortName.c_str(), errno, +                     errno == 13 ? " (Permission Denied)" : "");          if(!m_apLockFile.isNull()) {              m_apLockFile->unlock();          } @@ -282,7 +283,8 @@ bool SerialConnection::doOpen(const int32_t& timeoutMillis) {      int result = tcgetattr(m_iHandle, &m_stPrevOptions);      if (result == -1) { -        printWarning("SERIAL| Failed to get attributes on port [%s] [%d]", m_sPortName.c_str(), errno); +        printWarning("SERIAL| Failed to get attributes on port [%s] [%d]%s", m_sPortName.c_str(), errno, +                     errno == 13 ? " (Permission Denied)" : "");      }      termios options = m_stPrevOptions; @@ -413,7 +415,8 @@ bool SerialConnection::doOpen(const int32_t& timeoutMillis) {      result = tcsetattr(m_iHandle, TCSANOW, &options);      if (result == -1) { -        printWarning("SERIAL| Failed to set configurations on port [%s] [%d]", m_sPortName.c_str(), errno); +        printWarning("SERIAL| Failed to set configurations on port [%s] [%d]%s", m_sPortName.c_str(), errno, +                     errno == 13 ? " (Permission Denied)" : "");          goto CLEANUP;      }      result = tcflush(m_iHandle, TCIOFLUSH); | 
