A library for talking to Multi-Tech's Cellular SocketModem Devices.

Dependents:   M2X_dev axeda_wrapper_dev MTS_M2x_Example1 MTS_Cellular_Connect_Example ... more

Revision:
4:6561c9128c6f
Parent:
0:563b70517320
Child:
5:93e889a5abc6
--- a/cellular/Cellular.h	Mon Dec 09 16:10:26 2013 +0000
+++ b/cellular/Cellular.h	Wed Dec 11 16:49:21 2013 +0000
@@ -4,6 +4,7 @@
 #include "mbed.h"
 #include "MTSBufferedIO.h"
 #include <string>
+#include <vector>
 
 class Cellular
 {
@@ -20,7 +21,14 @@
         NOT_REGISTERED, REGISTERED, SEARCHING, DENIED, UNKNOWN, ROAMING
     };
 
-    Cellular(MTSBufferedIO* io);
+    struct Sms {
+            std::string phoneNumber;
+            std::string message;
+            std::string timestamp;
+    };
+    
+    
+    Cellular(MTSBufferedIO& io);
     ~Cellular();
 
     string sendCommand(string command, int timeoutMillis, ESC_CHAR esc = CR);
@@ -30,11 +38,18 @@
     Code echoOff(bool state);
     int getSignalStrength();
     Registration getRegistration();    
-    Code sendSMS(string phoneNumber, string message);
+    
+    //SMS
+    Code sendSMS(const std::string& phoneNumber, const std::string& message);
+    Code sendSMS(const Sms& sms);
+    std::vector<Cellular::Sms> getReceivedSms();
+    Code deleteAllReceivedSms();
+    Code deleteOnlyReceivedReadSms();
+    
     int connect(string host, int port);    
     
 private:
-    MTSBufferedIO* io;
+    MTSBufferedIO& io;
 };
 
 #endif /* CELLULAR_H */
\ No newline at end of file