a library to use GPRS like ethernet or wifi, which makes it possible to connect to the internet with your GPRS module

Dependencies:   BufferedSerial

Dependents:   ThinkSpeak_Test roam_v1 roam_v2 finalv3

Fork of GPRSInterface by wei zou

Revision:
0:8ccbd963e74d
Child:
1:7298a7950f65
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Socket/Socket.h	Tue Feb 25 02:52:48 2014 +0000
@@ -0,0 +1,56 @@
+/*
+  Socket.h
+  2014 Copyright (c) Seeed Technology Inc.  All right reserved.
+
+  Author:lawliet zou(lawliet.zou@gmail.com)
+  2014-2-24
+
+  This library is free software; you can redistribute it and/or
+  modify it under the terms of the GNU Lesser General Public
+  License as published by the Free Software Foundation; either
+  version 2.1 of the License, or (at your option) any later version.
+
+  This library is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with this library; if not, write to the Free Software
+  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+*/
+#ifndef SOCKET_H_
+#define SOCKET_H_
+
+#include "GPRS.h"
+
+/** Socket file descriptor and select wrapper
+  */
+class Socket {
+public:
+    /** Socket
+     */
+    Socket();
+    
+    /** Set blocking or non-blocking mode of the socket and a timeout on
+        blocking socket operations
+    \param blocking  true for blocking mode, false for non-blocking mode.
+    \param timeout   timeout in ms [Default: (1500)ms].
+    */
+    void set_blocking(bool blocking, unsigned int timeout=1500);
+    
+    /** Close the socket file descriptor
+     */
+    int close();
+    
+    ~Socket();
+    
+protected:
+    int _sock_fd;
+    bool _blocking;
+    int _timeout;
+    GPRS* gprs;
+};
+
+
+#endif /* SOCKET_H_ */