ME910 support

Fork of MTS-Cellular by MultiTech

Files at this revision

API Documentation at this revision

Comitter:
pferland
Date:
Thu Sep 07 16:11:14 2017 +0000
Parent:
80:e66bf5723b98
Commit message:
Preliminary support for ME910C1

Changed in this revision

Cellular/Cellular.cpp Show annotated file Show diff for this revision Revisions of this file
Cellular/Cellular.h Show annotated file Show diff for this revision Revisions of this file
Cellular/CellularFactory.cpp Show annotated file Show diff for this revision Revisions of this file
Cellular/EasyIP.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/Cellular/Cellular.cpp	Wed Sep 09 18:12:52 2015 +0000
+++ b/Cellular/Cellular.cpp	Thu Sep 07 16:11:14 2017 +0000
@@ -77,6 +77,8 @@
             return "MTSMC_LEU1";
         case MTSMC_LVW2:
             return "MTSMC_LVW2";
+        case MTSMC_LAT3:
+            return "MTSMC_LAT3";
         default:
             return "UNKNOWN ENUM";
     }
@@ -223,7 +225,7 @@
                     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 || type == MTSMC_LAT3) {
                     if (result.find("CONNECT\r\n") != std::string::npos) {
                         done = true;
                     } 
--- a/Cellular/Cellular.h	Wed Sep 09 18:12:52 2015 +0000
+++ b/Cellular/Cellular.h	Thu Sep 07 16:11:14 2017 +0000
@@ -245,7 +245,7 @@
 
     /// 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, MTSMC_LAT3
     };
 
     /// 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	Thu Sep 07 16:11:14 2017 +0000
@@ -43,6 +43,7 @@
     while (true) {
         string mNumber;
         model = sendCommand(io, "ATI4", 3000);
+        logTrace("Modem reported model: %s", model.c_str());
         if (uip) {
             if (model.find("HE910") != string::npos) {
                 type = Cellular::MTSMC_H5_IP;
@@ -75,6 +76,9 @@
             } else if (model.find("LE910-NAG") != string::npos) {
                 type = Cellular::MTSMC_LAT1;
                 mNumber = "LE910-NAG";
+            } else if(model.find("ME910C1-NV") != string::npos) {
+                type = Cellular::MTSMC_LAT3;
+                mNumber = "ME910C-NV";
             } else if (model.find("LE910-SVG") != string::npos) {
                 type = Cellular::MTSMC_LVW2;
                 mNumber = "LE910-SVG";
--- a/Cellular/EasyIP.cpp	Wed Sep 09 18:12:52 2015 +0000
+++ b/Cellular/EasyIP.cpp	Thu Sep 07 16:11:14 2017 +0000
@@ -106,7 +106,7 @@
     } while(tmr.read() < 30);
 
     //Make PPP connection
-    if (type == MTSMC_H5 || type == MTSMC_G3 || type == MTSMC_LAT1 || type == MTSMC_LEU1) {
+    if (type == MTSMC_H5 || type == MTSMC_G3 || type == MTSMC_LAT1 || type == MTSMC_LEU1 || type == MTSMC_LAT3) {
         logDebug("Making PPP Connection Attempt. APN[%s]", apn.c_str());
     } else {
         logDebug("Making PPP Connection Attempt");
@@ -315,7 +315,7 @@
         return false;
     }
     
-    if(type == MTSMC_EV3 || type == MTSMC_LAT1 || type == MTSMC_LEU1 || type == MTSMC_LVW2) {
+    if(type == MTSMC_EV3 || type == MTSMC_LAT1 || type == MTSMC_LEU1 || type == MTSMC_LVW2 || type == MTSMC_LAT3) {
         if(!local_port) {
             logDebug("Local port set to 1, port 0 not supported for %s", getRadioNames(type).c_str());
             local_port = 1;
@@ -526,7 +526,7 @@
         }
         this->apn = apn;
         return code;
-    } else if (type == MTSMC_LAT1 || type == MTSMC_LEU1) {
+    } else if (type == MTSMC_LAT1 || type == MTSMC_LEU1 || type == MTSMC_LAT3) {
          //CGDCONT has options: IP,PPP,IPv6
         Code code = sendBasicCommand("AT+CGDCONT=1,\"IP\",\"" + apn + "\"", 1000);
         if (code != MTS_SUCCESS) {