Cellular library for MTS Socket Modem Arduino Shield devices from Multi-Tech Systems
Dependents: mtsas mtsas mtsas mtsas
Revision 81:2e12915f892e, committed 2017-11-15
- Comitter:
- Leon Lindenfelser
- Date:
- Wed Nov 15 16:53:29 2017 -0600
- Parent:
- 80:e66bf5723b98
- Child:
- 82:5b33b670adb7
- Commit message:
- Add support for MTQ-MAT1(ME910C1-NA) and MTQ-MVW1(MT910C1-NV)
Changed in this revision
--- a/Cellular/Cellular.cpp Wed Sep 09 18:12:52 2015 +0000 +++ b/Cellular/Cellular.cpp Wed Nov 15 16:53:29 2017 -0600 @@ -77,6 +77,10 @@ return "MTSMC_LEU1"; case MTSMC_LVW2: return "MTSMC_LVW2"; + case MTQ_MAT1: + return "MTQ-MAT1"; + case MTQ_MVW1: + return "MTQ-MVW1"; default: return "UNKNOWN ENUM"; } @@ -223,7 +227,8 @@ done = true; } - if(type == MTSMC_H5 || type == MTSMC_G3 || type == MTSMC_EV3 || type == MTSMC_C2 || type == MTSMC_LAT1 || type == MTSMC_LEU1 || type == MTSMC_LVW2) { + if(type == MTSMC_H5 || type == MTSMC_G3 || type == MTSMC_EV3 || type == MTSMC_C2 || type == MTSMC_LAT1 || type == MTSMC_LEU1 || + type == MTSMC_LVW2 || MTQ_MAT1 || MTQ_MVW1) { if (result.find("CONNECT\r\n") != std::string::npos) { done = true; } @@ -255,7 +260,7 @@ { string csmp; - if (type == MTSMC_H5_IP || type == MTSMC_H5 || type == MTSMC_G3 || type == MTSMC_LAT1 || type == MTSMC_LEU1) { + if (type == MTSMC_H5_IP || type == MTSMC_H5 || type == MTSMC_G3 || type == MTSMC_LAT1 || type == MTSMC_LEU1 || MTQ_MAT1 || MTQ_MVW1) { csmp = "AT+CSMP=17,167,0,0"; } else if (type == MTSMC_EV3_IP || type == MTSMC_EV3 || type == MTSMC_C2_IP || type == MTSMC_C2 || type == MTSMC_LVW2) { csmp = "AT+CSMP=,4098,0,2"; @@ -326,7 +331,7 @@ } //Start of SMS message std::vector<std::string> vSmsParts = Text::split(line, ','); - if (type == MTSMC_H5_IP || type == MTSMC_H5 || type == MTSMC_G3 || type == MTSMC_LAT1 || type == MTSMC_LEU1) { + if (type == MTSMC_H5_IP || type == MTSMC_H5 || type == MTSMC_G3 || type == MTSMC_LAT1 || type == MTSMC_LEU1 || MTQ_MAT1 || MTQ_MVW1) { /* format for H5 and H5-IP radios * <index>, <status>, <oa>, <alpha>, <scts> * scts contains a comma, so splitting on commas should give us 6 items
--- a/Cellular/Cellular.h Wed Sep 09 18:12:52 2015 +0000 +++ b/Cellular/Cellular.h Wed Nov 15 16:53:29 2017 -0600 @@ -245,7 +245,8 @@ /// Enumeration for different cellular radio types. enum Radio { - NA, MTSMC_H5, MTSMC_EV3, MTSMC_G3, MTSMC_C2, MTSMC_H5_IP, MTSMC_EV3_IP, MTSMC_C2_IP, MTSMC_LAT1, MTSMC_LVW2, MTSMC_LEU1 + NA, MTSMC_H5, MTSMC_EV3, MTSMC_G3, MTSMC_C2, MTSMC_H5_IP, MTSMC_EV3_IP, MTSMC_C2_IP, MTSMC_LAT1, MTSMC_LVW2, MTSMC_LEU1, + MTQ_MAT1, MTQ_MVW1 }; /// An enumeration of radio registration states with a cell tower.
--- a/Cellular/CellularFactory.cpp Wed Sep 09 18:12:52 2015 +0000 +++ b/Cellular/CellularFactory.cpp Wed Nov 15 16:53:29 2017 -0600 @@ -81,6 +81,12 @@ } else if (model.find("LE910-EUG") != string::npos) { type = Cellular::MTSMC_LEU1; mNumber = "LE910-EUG"; + } else if (model.find("ME910C1-NA") != string::npos) { + type = Cellular::MTQ_MAT1; + mNumber = "ME910C1-NA"; + } else if (model.find("ME910C1-NV") != string::npos) { + type = Cellular::MTQ_MVW1; + mNumber = "ME910C1-NV"; } if (type != Cellular::NA) { cell = new EasyIP(type);
--- a/Cellular/EasyIP.cpp Wed Sep 09 18:12:52 2015 +0000 +++ b/Cellular/EasyIP.cpp Wed Nov 15 16:53:29 2017 -0600 @@ -534,6 +534,16 @@ } this->apn = apn; return code; + } else if (type == MTQ_MAT1) { + Code code = sendBasicCommand("AT+CGDCONT=1,\"IPV4V6\",\"" + apn + "\"", 1000); + if (code != MTS_SUCCESS) { + return code; + } + this->apn = apn; + return code; + } else if (type == MTQ_MVW1) { + logInfo("MTQ_MVW1 does not need an APN"); + return MTS_SUCCESS; } else { logInfo("CDMA radios don't need an APN"); return MTS_SUCCESS;