C027_SupportTest_xively_locationで使用しているC027用ライブラリ

Fork of C027_Support by u-blox

下記のプログラムC027_SupportTest_xively_locationで使用しているC027用ライブラリです。

Import programC027_SupportTest_xively_location

インターフェース2014年10月号のu-blox C027で3G通信する記事で使用したプログラム。   CQ publishing Interface 2014.10 issue, C027 3G test program.

オリジナルのライブラリは下記を参照してください。

Import libraryC027_Support

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.

Revision:
44:9d12223b78ff
Parent:
38:e6cab4632d84
Child:
51:e7b81c31baec
--- a/MDM.h	Fri Apr 11 20:10:28 2014 +0000
+++ b/MDM.h	Thu Apr 17 20:41:30 2014 +0000
@@ -22,6 +22,8 @@
 public:
     //! Constructor 
     MDMParser();
+    //! get static instance
+    static MDMParser* getInstance() { return inst; };
     
     // ----------------------------------------------------------------
     // Types 
@@ -142,6 +144,19 @@
     */
     bool socketConnect(int socket, const char* host, int port);
         
+    /** make a socket connection
+        \param socket the socket handle
+        \return true if connected, false otherwise
+    */
+    bool socketIsConnected(int socket);
+     
+    /** Get the number of bytes pending for reading for this socket
+        \param socket the socket handle
+        \param timeout_ms -1 blocking, else non blocking timeout in ms
+        \return 0 if successful or SOCKET_ERROR on failure 
+    */
+    bool socketSetBlocking(int socket, unsigned int timeout_ms);
+    
     /** Write socket data 
         \param socket the socket handle
         \param buf the buffer to write
@@ -398,8 +413,9 @@
     IP          _ip;  //!< assigned ip address
     // management struture for sockets
     typedef enum { SOCK_FREE, SOCK_CREATED, SOCK_CONNECTED } SockState;
-    typedef struct { SockState state; int pending; } SockCtrl;
+    typedef struct { SockState state; int pending; unsigned int timeout_ms; } SockCtrl;
     SockCtrl _sockets[16];
+    static MDMParser* inst;
 };
 
 // -----------------------------------------------------------------------