Simple detection for LE910-NA1 modules

Fork of MTS-Cellular by MultiTech

Revision:
56:43205bd2752a
Parent:
54:a6c738bfc391
Child:
59:5535f14e3cc4
--- a/Cellular/UIP.cpp	Mon Aug 11 21:01:50 2014 +0000
+++ b/Cellular/UIP.cpp	Wed Aug 13 16:46:10 2014 +0000
@@ -173,21 +173,6 @@
     return pppConnected;
 }
 
-
-bool UIP::bind(unsigned int port)
-{
-    if(socketOpened) {
-        logError("socket is open. Can not set local port");
-        return false;
-    }
-    if(port > 65535) {
-        logError("port out of range (0-65535)");
-        return false;
-    }
-    local_port = port;
-    return true;
-}
-
 bool UIP::open(const std::string& address, unsigned int port, Mode mode)
 {
     char buffer[256] = {0};
@@ -295,15 +280,6 @@
     return socketOpened;
 }
 
-bool UIP::isOpen()
-{
-    if(io->readable()) {
-        logDebug("Assuming open, data available to read.");
-        return true;
-    }
-    return socketOpened;
-}
-
 bool UIP::close()
 {
     if(io == NULL) {
@@ -498,43 +474,6 @@
     return bytesWritten;
 }
 
-unsigned int UIP::readable()
-{
-    if(io == NULL) {
-        logWarning("MTSBufferedIO not set");
-        return 0;
-    }
-    if(!socketOpened && !io->readable()) {
-        logWarning("Socket is not open");
-        return 0;
-    }
-    return io->readable();
-}
-
-unsigned int UIP::writeable()
-{
-    if(io == NULL) {
-        logWarning("MTSBufferedIO not set");
-        return 0;
-    }
-    if(!socketOpened) {
-        logWarning("Socket is not open");
-        return 0;
-    }
-
-    return io->writeable();
-}
-
-bool UIP::setDeviceIP(std::string address)
-{
-    if (address.compare("DHCP") == 0) {
-        return true;
-    } else {
-        logWarning("Radio does not support static IPs, using DHCP.\n\r");
-        return false;
-    }
-}
-
 Code UIP::setApn(const std::string& apn)
 {
     if (type == MTSMC_H5_IP) {
@@ -561,24 +500,6 @@
     }
 }
 
-std::string UIP::getDeviceIP()
-{
-    return local_address;
-}
-
-Code UIP::echo(bool state)
-{
-    Code code;
-    if (state) {
-        code = sendBasicCommand("ATE0", 1000);
-        echoMode = (code == MTS_SUCCESS) ? false : echoMode;
-    } else {
-        code = sendBasicCommand("ATE1", 1000);
-        echoMode = (code == MTS_SUCCESS) ? true : echoMode;
-    }
-    return code;
-}
-
 bool UIP::ping(const std::string& address)
 {
     char buffer[256] = {0};
@@ -614,20 +535,4 @@
         }
     }
     return false;
-}
-
-Code UIP::setSocketCloseable(bool enabled)
-{
-    if(socketCloseable == enabled) {
-        return MTS_SUCCESS;
-    }
-
-    if(socketOpened) {
-        logError("socket is already opened. Can not set closeable");
-        return MTS_ERROR;
-    }
-
-    socketCloseable = enabled;
-
-    return MTS_SUCCESS;
-}
+}
\ No newline at end of file