Add a bunch of APNs

Fork of C027_Support by Xinlei Cao

Revision:
28:4d9509e3b1cf
Parent:
26:07be5faf8925
Child:
29:53d346010624
--- a/MDM.h	Tue Apr 08 13:53:27 2014 +0000
+++ b/MDM.h	Tue Apr 08 14:11:03 2014 +0000
@@ -42,9 +42,13 @@
     #define SOCKET_ERROR -1
     #define SOCKET_OK     0 
     typedef uint32_t IP;
+    
+    typedef enum { MODEL_UNKNOWN, MODEL_SARA_G350, MODEL_LISA_U200, MODEL_LISA_C200 } Model; 
+    typedef enum { SIM_UNKNOWN, SIM_PIN, SIM_READY } Sim; 
+    typedef struct { Model model; Sim sim; const char* imsi; const char* imei; const char* ccid; } DevStatus;
     typedef enum { NET_UNKNOWN, NET_DENIED, NET_NONE, NET_HOME, NET_ROAMING } Net; 
     typedef enum { ACT_UNKNOWN, ACT_GSM, ACT_EDGE, ACT_UTRAN, ACT_CDMA } AcT; 
-    typedef struct { const char* num; const char* opr; int rssi; Net net; AcT act; } Status;
+    typedef struct { const char* num; const char* opr; int rssi; Net net; AcT act; } NetStatus;
     
     MDMParser(void);
     
@@ -65,11 +69,11 @@
         return waitFinalResp((_CALLBACKPTR)cb, (void*)param, timeout_ms);
     }
     // network
-    bool init(const char* pin = NULL);
-    bool checkNetStatus(Status* info = NULL);
+    bool init(const char* pin = NULL, DevStatus* status = NULL);
+    bool checkNetStatus(NetStatus* status = NULL);
     bool powerOff(void);
     // internet connection
-    bool join(const char* apn, const char* user = NULL, const char* password = NULL);
+    bool join(const char* apn = NULL, const char* user = NULL, const char* password = NULL);
     bool disconnect(void);
     bool gethostbyname(const char* host, IP* ip);
     // socket interface
@@ -95,8 +99,6 @@
     static int _parseFormated(Pipe<char>* pipe, int len, const char* fmt);
     virtual int _send(const void* buf, int len) = 0;
 private:
-    typedef enum { MODEL_UNKNOWN, MODEL_SARA_G350, MODEL_LISA_U200, MODEL_LISA_C200 } Model; 
-    typedef enum { SIM_UNKNOWN, SIM_PIN, SIM_READY } Sim; 
     static int _cbATI(int type, const char* buf, int len, Model* model);
     static int _cbCIMI(int type, const char* buf, int len, char* imsi);
     static int _cbUDNSRN(int type, const char* buf, int len, IP* ip);