Cellular library for MTS Socket Modem Arduino Shield devices from Multi-Tech Systems

Dependents:   mtsas mtsas mtsas mtsas

Files at this revision

API Documentation at this revision

Comitter:
Vanger
Date:
Tue Oct 21 21:06:53 2014 +0000
Parent:
66:8c55e2bf7270
Child:
68:66f4126100b5
Commit message:
Fixed close() variables to match Mbed socket API (shutdown instead of clearBuffer)

Changed in this revision

Cellular/EasyIP.cpp Show annotated file Show diff for this revision Revisions of this file
Cellular/EasyIP.h Show annotated file Show diff for this revision Revisions of this file
Cellular/UIP.cpp Show annotated file Show diff for this revision Revisions of this file
Cellular/UIP.h Show annotated file Show diff for this revision Revisions of this file
Test/TestSMS.h Show annotated file Show diff for this revision Revisions of this file
--- a/Cellular/EasyIP.cpp	Tue Oct 21 17:26:05 2014 +0000
+++ b/Cellular/EasyIP.cpp	Tue Oct 21 21:06:53 2014 +0000
@@ -351,7 +351,7 @@
 }
 
 //Closes socket connection
-bool EasyIP::close(bool clearBuffer)
+bool EasyIP::close(bool shutdown)
 {
     
     if(io == NULL) {
@@ -381,11 +381,9 @@
     }
     
     //Clear receive buffer
-    if (clearBuffer) {
-        Timer tmr;
+    if (shutdown) {
         int counter = 0;
         char tmp[256];
-        tmr.start();
         do {
             if(socketOpened == false) {
                 break;
--- a/Cellular/EasyIP.h	Tue Oct 21 17:26:05 2014 +0000
+++ b/Cellular/EasyIP.h	Tue Oct 21 21:06:53 2014 +0000
@@ -85,7 +85,7 @@
     // For behavior of the following methods refer to IPStack.h documentation
     
     virtual bool open(const std::string& address, unsigned int port, Mode mode);
-    virtual bool close(bool clearBuffer);
+    virtual bool close(bool shutdown);
     virtual int read(char* data, int max, int timeout = -1);    
     virtual int write(const char* data, int length, int timeout = -1);
     
--- a/Cellular/UIP.cpp	Tue Oct 21 17:26:05 2014 +0000
+++ b/Cellular/UIP.cpp	Tue Oct 21 21:06:53 2014 +0000
@@ -280,7 +280,7 @@
     return socketOpened;
 }
 
-bool UIP::close(bool clearBuffer)
+bool UIP::close(bool shutdown)
 {
     if(io == NULL) {
         logError("MTSBufferedIO not set");
@@ -302,11 +302,9 @@
         return false;
     }
 
-    if (clearBuffer) {
-        Timer tmr;
+    if (shutdown) {
         int counter = 0;
         char tmp[256];
-        tmr.start();
         do {
             if(socketOpened == false) {
                 break;
--- a/Cellular/UIP.h	Tue Oct 21 17:26:05 2014 +0000
+++ b/Cellular/UIP.h	Tue Oct 21 21:06:53 2014 +0000
@@ -78,7 +78,7 @@
     // TCP and UDP Socket related commands
     // For behavior of the following methods refer to IPStack.h documentation
     virtual bool open(const std::string& address, unsigned int port, Mode mode);
-    virtual bool close(bool clearBufffer);
+    virtual bool close(bool shutdown);
     virtual int read(char* data, int max, int timeout = -1);
     virtual int write(const char* data, int length, int timeout = -1);
     virtual bool ping(const std::string& address = "8.8.8.8");
--- a/Test/TestSMS.h	Tue Oct 21 17:26:05 2014 +0000
+++ b/Test/TestSMS.h	Tue Oct 21 21:06:53 2014 +0000
@@ -22,7 +22,7 @@
 TestSMS::TestSMS() : TestCollection("TestSMS") {}
 
 void TestSMS::run() {
-    const char APN[] = "";
+    const char APN[] = "dynamic.dcnm2m.com";
     
     string number;
     string response;