From 2140f3948e70254ed70b0d543cb03e18564ec4f3 Mon Sep 17 00:00:00 2001 From: Jeff Hatch Date: Wed, 31 Oct 2018 15:55:31 -0500 Subject: Add support for LE910C1-NS radio --- src/MTS_IO_CellularRadio.cpp | 8 +++++++ src/MTS_IO_CellularRadioFactory.cpp | 6 +++++ src/MTS_IO_LE910C1NSRadio.cpp | 45 +++++++++++++++++++++++++++++++++++++ 3 files changed, 59 insertions(+) create mode 100644 src/MTS_IO_LE910C1NSRadio.cpp (limited to 'src') diff --git a/src/MTS_IO_CellularRadio.cpp b/src/MTS_IO_CellularRadio.cpp index f84cb6e..f2b4826 100644 --- a/src/MTS_IO_CellularRadio.cpp +++ b/src/MTS_IO_CellularRadio.cpp @@ -318,6 +318,9 @@ CellularRadio::CODE CellularRadio::convertModelToMtsShortCode(const std::string& } else if (sModel.find("LE910-SVG") == 0) { sCode = "LVW2"; eCode = SUCCESS; + } else if (sModel.find("LE910C1-NS") == 0) { + sCode = "LSP3"; + eCode = SUCCESS; } else if (sModel.find("ME910C1-NA") == 0) { sCode = "MAT1"; eCode = SUCCESS; @@ -402,6 +405,9 @@ CellularRadio::CODE CellularRadio::convertModelToType(const std::string& sModel, } else if (sModel.find("LE910-EU1") == 0) { sType = VALUE_TYPE_LTE; eCode = SUCCESS; + } else if (sModel.find("LE910C1-NS") == 0) { + sType = VALUE_TYPE_LTE; + eCode = SUCCESS; } else if (sModel.find("ME910C1-NA") == 0) { sType = VALUE_TYPE_LTE; eCode = SUCCESS; @@ -1597,6 +1603,8 @@ std::string CellularRadio::extractModelFromResult(const std::string& sResult) { sModel = "LE910-EUG"; } else if(sResult.find("LE910-EU1") != std::string::npos) { sModel = "LE910-EU1"; + } else if(sResult.find("LE910C1-NS") != std::string::npos) { + sModel = "LE910C1-NS"; } else if(sResult.find("GE910") != std::string::npos) { sModel = "GE910"; } else if(sResult.find("DE910-DUAL") != std::string::npos) { diff --git a/src/MTS_IO_CellularRadioFactory.cpp b/src/MTS_IO_CellularRadioFactory.cpp index 5a490cc..ea93f28 100644 --- a/src/MTS_IO_CellularRadioFactory.cpp +++ b/src/MTS_IO_CellularRadioFactory.cpp @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -53,6 +54,7 @@ CellularRadioFactory::CellularRadioFactory() { m_mCreationMap[LE910SVGRadio::MODEL_NAME] = &CellularRadioFactory::createLE910SVG; m_mCreationMap[LE910EUGRadio::MODEL_NAME] = &CellularRadioFactory::createLE910EUG; m_mCreationMap[LE910EU1Radio::MODEL_NAME] = &CellularRadioFactory::createLE910EU1; + m_mCreationMap[LE910C1NSRadio::MODEL_NAME] = &CellularRadioFactory::createLE910C1NS; m_mCreationMap[ME910C1NARadio::MODEL_NAME] = &CellularRadioFactory::createME910C1NA; m_mCreationMap[ME910C1NVRadio::MODEL_NAME] = &CellularRadioFactory::createME910C1NV; m_mCreationMap[GE910Radio::MODEL_NAME] = &CellularRadioFactory::createGE910; @@ -150,6 +152,10 @@ CellularRadio* CellularRadioFactory::createLE910EU1(const std::string& sPort) { return new LE910EU1Radio(sPort); } +CellularRadio* CellularRadioFactory::createLE910C1NS(const std::string& sPort) { + return new LE910C1NSRadio(sPort); +} + CellularRadio* CellularRadioFactory::createME910C1NA(const std::string& sPort) { return new ME910C1NARadio(sPort); } diff --git a/src/MTS_IO_LE910C1NSRadio.cpp b/src/MTS_IO_LE910C1NSRadio.cpp new file mode 100644 index 0000000..6c403a0 --- /dev/null +++ b/src/MTS_IO_LE910C1NSRadio.cpp @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2015 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 . + * + */ + +/*! + \file MTS_IO_LE910SVGRadio.cpp + \brief A brief description + \date Jan 19, 2015 + \author sgodinez + + A more elaborate description +*/ + +#include + +using namespace MTS::IO; + +const std::string LE910C1NSRadio::MODEL_NAME("LE910C1-NS"); + +LE910C1NSRadio::LE910C1NSRadio(const std::string& sPort) +: LE910Radio(MODEL_NAME, sPort) +{ + +} + +CellularRadio::CODE LE910C1NSRadio::getCarrier(std::string& sCarrier) { + sCarrier = "Sprint"; + return SUCCESS; +} -- cgit v1.2.3