diff options
author | Mykola Salomatin <mykola.salomatin@globallogic.com> | 2022-05-04 12:40:15 +0300 |
---|---|---|
committer | John Klug <john.klug@multitech.com> | 2022-06-17 10:26:56 -0500 |
commit | dc05152d236dd42dd31206cf2d3f439491b73300 (patch) | |
tree | 7ab78bc6273ffa42305c342f1fe71d1ffa1d6779 /src/MTS_IO_EG95Radio.cpp | |
parent | 117b5c87afafb24500f820942f5f6724c426ad11 (diff) | |
download | libmts-io-dc05152d236dd42dd31206cf2d3f439491b73300.tar.gz libmts-io-dc05152d236dd42dd31206cf2d3f439491b73300.tar.bz2 libmts-io-dc05152d236dd42dd31206cf2d3f439491b73300.zip |
[MTX-4445] mPower R.6.0.X: MTCAP3: LNA7D - cellular radio support GP-15481.0.29
setRxDiversity command moved to common class for Quectel radios - QuectelRadio.cpp.
Add LNA7D radio support.
LNA7D radio supports only 3g and 4g network modes.
Add new command for enabling/disabling diversity. Retained backward compatibility with the old diversity command.
Diffstat (limited to 'src/MTS_IO_EG95Radio.cpp')
-rw-r--r-- | src/MTS_IO_EG95Radio.cpp | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/src/MTS_IO_EG95Radio.cpp b/src/MTS_IO_EG95Radio.cpp index 296f183..83d6489 100644 --- a/src/MTS_IO_EG95Radio.cpp +++ b/src/MTS_IO_EG95Radio.cpp @@ -19,6 +19,7 @@ */ #include <mts/MTS_IO_EG95Radio.h> +#include <mts/MTS_Logger.h> using namespace MTS::IO; @@ -34,18 +35,21 @@ EG95Radio::~EG95Radio() { } -ICellularRadio::CODE EG95Radio::setRxDiversity(const Json::Value& jArgs) { - /* Command string for EG95 radios: AT+QCFG="diversity",(0-1) */ - if (jArgs["enabled"].asString() != "1" && jArgs["enabled"].asString() != "0") { - return FAILURE; +ICellularRadio::CODE EG95Radio::getSupportedCellularModes(CELLULAR_MODES &networks) { + std::string sRadioCode; + ICellularRadio::CODE iCode; + + iCode = convertModelToMtsShortCode(MODEL_NAME, sRadioCode, this); + if (iCode != SUCCESS) { + printError("%s| Failed to obtain radio code: [%d]", getName().c_str(), iCode); + return iCode; } - std::string sCmd = "AT+QCFG=\"diversity\","; - sCmd += jArgs["enabled"].asString(); - return sendBasicCommand(sCmd); -} + if (sRadioCode == "LNA7D") { + networks = static_cast<CELLULAR_MODES>(CELLULAR_MODE_3G | CELLULAR_MODE_4G); + } else { + networks = static_cast<CELLULAR_MODES>(CELLULAR_MODE_2G | CELLULAR_MODE_3G | CELLULAR_MODE_4G); + } -ICellularRadio::CODE EG95Radio::getSupportedCellularModes(CELLULAR_MODES &networks) { - networks = static_cast<CELLULAR_MODES>(CELLULAR_MODE_2G | CELLULAR_MODE_3G | CELLULAR_MODE_4G); return SUCCESS; }
\ No newline at end of file |