ghrh

Revision:
1:642a8dbe076c
Parent:
0:a5ae94727346
Child:
2:16985da3a446
diff -r a5ae94727346 -r 642a8dbe076c gprs.h
--- a/gprs.h	Thu Nov 14 09:39:58 2013 +0000
+++ b/gprs.h	Fri Nov 15 03:40:35 2013 +0000
@@ -25,30 +25,37 @@
 
 #include "mbed.h"
 
-class gprs{
+class gprs
+{
 
-	public:
-		int init(void);
-		int readBuffer(char *buffer,int count);
-		void sendCmd(char *cmd);
-		int waitForResp(char *resp, int timeout);
-		int sendCmdAndWaitForResp(char *cmd, char *resp, int timeout);
-		int checkSIMStatus(void);
-		int checkSignalStrength(void);
-		int networkInit(void);
-		int sendSMS(char *number, char *data);
-		int sendSMS(void);
-		int readSMS(char *buffer, char *message, bool check);
-		int deleteSMS(int index);
-		int callUp(char *number);
-		int answerWithCheck(char *gprsBuffer, bool check);
-		int loop(bool check);
-		int connectTCP(char *ip, char *port);
-		int sendTCPData(char *data);
-		int closeTCP(void);
-		int shutTCP(void);
-		void serialDebug(void);
-		
+public:
+    gprs(PinName tx, PinName rx, int baudrate,char *Number) : gprsSerial(tx, rx) {
+        gprsSerial.baud(baudrate);
+        phoneNumber = Number;
+    };
+    int init(void);
+    int readBuffer(char *buffer,int count);
+    void sendCmd(char *cmd);
+    int waitForResp(char *resp, int timeout);
+    int sendCmdAndWaitForResp(char *cmd, char *resp, int timeout);
+    int checkSIMStatus(void);
+    int checkSignalStrength(void);
+    int networkInit(void);
+    int sendSMS(char *number, char *data);
+    int readSMS(char *buffer, char *message, bool check);
+    int deleteSMS(int index);
+    int callUp(char *number);
+    int answer(void);
+    int loop(bool check);
+    int connectTCP(char *ip, char *port);
+    int sendTCPData(char *data);
+    int closeTCP(void);
+    int shutTCP(void);
+    void serialDebug(PinName tx, PinName rx);
+private:
+    Serial gprsSerial;
+    Timer timeCnt;
+    char *phoneNumber;
 };
 
 //extern gprs GPRS;