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:
146:efc4db23a564
Parent:
141:571e0ef6c8dc
--- a/Socket/Transport.cpp	Wed Jan 15 19:26:13 2014 +0000
+++ b/Socket/Transport.cpp	Mon Jan 20 15:33:54 2014 +0000
@@ -20,11 +20,23 @@
 
 Transport::TransportType Transport::_type = Transport::NONE;
 
+IPStack* Transport::customType = NULL;
+
 void Transport::setTransport(TransportType type)
 {
+    if (type == CUSTOM) {
+        printf("[ERROR] Transport not set, use other setTransport method for setting custom type.\n\r");
+        return;
+    }
     _type = type;
 }
 
+void Transport::setTransport(IPStack* type)
+{
+    customType = type;
+    _type = CUSTOM;
+}
+
 IPStack* Transport::getInstance()
 {
     switch (_type) {
@@ -32,6 +44,8 @@
             return (IPStack*) Cellular::getInstance();
         case WIFI:
             return (IPStack*) Wifi::getInstance();
+        case CUSTOM:
+            return customType;
         default:
             printf("[ERROR] Transport not set, use setTransport method.\n\r");
             return NULL;