Support for LISA-N101
Fork of C027_Support by
This is a variant of the C027 driver code for the C027N version, i.e. the one with the Neul/Huawei/u-blox Cellular Internet of Things module on board. The AT command interface for this module is entirely different to the AT interface for the other u-blox modules, hence this fork of the driver. Work is underway to rearchitect the original C027 driver so that a merge can be done.
Diff: MDM.h
- 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; }; // -----------------------------------------------------------------------