support library for C027 helper functions for Buffer Pipes, Buffered Serial Port (rtos capable) and GPS parsing. It includes modem APIs for USSD, SMS and Sockets.
Fork of C027_Support by
Diff: MDM.h
- Revision:
- 25:4045d02e44f1
- Parent:
- 24:0e287a85ac9e
- Child:
- 26:07be5faf8925
diff -r 0e287a85ac9e -r 4045d02e44f1 MDM.h --- a/MDM.h Tue Apr 08 11:15:33 2014 +0000 +++ b/MDM.h Tue Apr 08 11:59:28 2014 +0000 @@ -42,6 +42,9 @@ #define SOCKET_ERROR -1 #define SOCKET_OK 0 typedef uint32_t IP; + 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; MDMParser(void); @@ -54,7 +57,7 @@ // network bool init(const char* pin = NULL); - bool checkNetStatus(void); + bool checkNetStatus(Status* info = NULL); bool powerOff(void); // internet connection bool join(const char* apn, const char* user = NULL, const char* password = NULL); @@ -84,7 +87,6 @@ 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 { NET_UNKNOWN, NET_DENIED, NET_NONE, NET_HOME, NET_ROAMING } Net; typedef enum { SIM_UNKNOWN, SIM_PIN, SIM_READY } Sim; static int _cbATI(int type, const char* buf, int len, Model* model); static int _cbUDNSRN(int type, const char* buf, int len, IP* ip); @@ -100,7 +102,9 @@ Model _model; Sim _sim; Net _net; + AcT _act; char _num[32]; + char _opr[32]; int _rssi; private: typedef enum { SOCK_FREE, SOCK_CREATED, SOCK_CONNECTED } SockState;