summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Marcaccini <david.marcaccini@multitech.com>2019-03-08 13:19:52 -0600
committerDavid Marcaccini <david.marcaccini@multitech.com>2019-03-08 13:19:52 -0600
commit36d1c638d115caefc042fe7a172cc531bb9e1436 (patch)
treea79037887a483039e9c347d213c519dc52706465
parent4df85d1a64ded69f1ddd6c4c26e4f52773605c4a (diff)
downloadlibmts-io-36d1c638d115caefc042fe7a172cc531bb9e1436.tar.gz
libmts-io-36d1c638d115caefc042fe7a172cc531bb9e1436.tar.bz2
libmts-io-36d1c638d115caefc042fe7a172cc531bb9e1436.zip
Add support for the ME910C1-WW Radio1.0.15
-rw-r--r--Makefile2
-rw-r--r--include/mts/MTS_IO_CellularRadioFactory.h1
-rw-r--r--include/mts/MTS_IO_ME910C1WWRadio.h46
-rw-r--r--include/mts/MTS_IO_ME910Radio.h10
-rw-r--r--src/MTS_IO_CellularRadio.cpp8
-rw-r--r--src/MTS_IO_CellularRadioFactory.cpp6
-rw-r--r--src/MTS_IO_ME910C1WWRadio.cpp36
-rw-r--r--src/MTS_IO_ME910Radio.cpp9
-rw-r--r--src/MTS_IO_SerialConnection.cpp9
9 files changed, 107 insertions, 20 deletions
diff --git a/Makefile b/Makefile
index 80dd7c1..bf45134 100644
--- a/Makefile
+++ b/Makefile
@@ -27,6 +27,7 @@ MTS_IO_LE910C1NSRadio.o \
MTS_IO_LE910C1APRadio.o \
MTS_IO_ME910C1NARadio.o \
MTS_IO_ME910C1NVRadio.o \
+MTS_IO_ME910C1WWRadio.o \
MTS_IO_ME910Radio.o \
MTS_IO_LockFile.o \
MTS_IO_MccMncTable.o \
@@ -56,6 +57,7 @@ MTS_IO_LE910C1NSRadio.d \
MTS_IO_LE910C1APRadio.d \
MTS_IO_ME910C1NARadio.d \
MTS_IO_ME910C1NVRadio.d \
+MTS_IO_ME910C1WWRadio.d \
MTS_IO_ME910Radio.d \
MTS_IO_LockFile.d \
MTS_IO_MccMncTable.d \
diff --git a/include/mts/MTS_IO_CellularRadioFactory.h b/include/mts/MTS_IO_CellularRadioFactory.h
index b2db5aa..69cdd38 100644
--- a/include/mts/MTS_IO_CellularRadioFactory.h
+++ b/include/mts/MTS_IO_CellularRadioFactory.h
@@ -52,6 +52,7 @@ namespace MTS {
virtual CellularRadio* createLE910C1AP(const std::string& sPort = CellularRadio::DEFAULT_RADIO_PORT);
virtual CellularRadio* createME910C1NA(const std::string& sPort = CellularRadio::DEFAULT_RADIO_PORT);
virtual CellularRadio* createME910C1NV(const std::string& sPort = CellularRadio::DEFAULT_RADIO_PORT);
+ virtual CellularRadio* createME910C1WW(const std::string& sPort = CellularRadio::DEFAULT_RADIO_PORT);
virtual CellularRadio* createGE910(const std::string& sPort = CellularRadio::DEFAULT_RADIO_PORT);
virtual CellularRadio* createDE910(const std::string& sPort = CellularRadio::DEFAULT_RADIO_PORT);
virtual CellularRadio* createCE910(const std::string& sPort = CellularRadio::DEFAULT_RADIO_PORT);
diff --git a/include/mts/MTS_IO_ME910C1WWRadio.h b/include/mts/MTS_IO_ME910C1WWRadio.h
new file mode 100644
index 0000000..a72160d
--- /dev/null
+++ b/include/mts/MTS_IO_ME910C1WWRadio.h
@@ -0,0 +1,46 @@
+/*
+ * 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/>.
+ *
+ */
+
+#ifndef MTS_IO_ME910C1WWRADIO_H_
+#define MTS_IO_ME910C1WWRADIO_H_
+
+#include <mts/MTS_IO_ME910Radio.h>
+
+namespace MTS {
+ namespace IO {
+
+ class ME910C1WWRadio : public ME910Radio {
+
+ public:
+ static const std::string MODEL_NAME;
+
+ ME910C1WWRadio(const std::string& sPort);
+ virtual ~ME910C1WWRadio(){};
+ virtual CODE getCarrier(std::string& sCarrier);
+
+ protected:
+
+ private:
+
+ };
+ }
+}
+
+#endif /* MTS_IO_ME910C1WWRADIO_H_ */
diff --git a/include/mts/MTS_IO_ME910Radio.h b/include/mts/MTS_IO_ME910Radio.h
index e665d19..91cdfc6 100644
--- a/include/mts/MTS_IO_ME910Radio.h
+++ b/include/mts/MTS_IO_ME910Radio.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2015 by Multi-Tech Systems
+ * Copyright (C) 2019 by Multi-Tech Systems
*
* This file is part of libmts-io.
*
@@ -18,14 +18,6 @@
*
*/
-/*!
- \file MTS_IO_ME910Radio.h
- \brief A brief description
- \date Nov 5, 2014
- \author sgodinez
-
- A more elaborate description
-*/
#ifndef MTS_IO_ME910RADIO_H_
#define MTS_IO_ME910RADIO_H_
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);