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.

Dependents:   HTTPClient_Cellular_HelloWorld Cellular_HelloMQTT MbedSmartRestMain Car_Bon_car_module ... more

This library is intended to be used with u-blox products such as the C027 or a shield with u-blox cellular and GPS modules like the cellular and positioning shield from Embedded Artist.

For 2G/GSM and 3G/UMTS you need to:

  • have a SIM card and know its PIN number
  • need to know you network operators APN setting These setting should be passed to the connect or init and join functions. You can also extend the APN database in MDMAPN.h.

For CDMA products you need to make sure that you have provisioned and activated the modem with either Sprint or Verizon.

Revision:
63:42cb563a25bc
Parent:
59:382695f1ce85
Child:
66:69072b3c5bca
--- a/MDM.h	Tue May 13 07:13:27 2014 +0000
+++ b/MDM.h	Tue May 13 12:31:33 2014 +0000
@@ -146,11 +146,12 @@
     //! Socket error return codes
     #define SOCKET_ERROR -1
     
-    /** Create a socket for a ip protocol
+    /** Create a socket for a ip protocol (and optionaly bind)
         \param ipproto the protocol (UDP or TCP) 
+        \param port in case of UDP, this optional port where it is bind
         \return the socket handle if successful or SOCKET_ERROR on failure 
     */
-    int socketSocket(IpProtocol ipproto);
+    int socketSocket(IpProtocol ipproto, int port = -1);
     
     /** make a socket connection
         \param socket the socket handle
@@ -207,12 +208,13 @@
     
     /** Read from this socket
         \param socket the socket handle
+        \param ip the ip of host where the data originates from
+        \param port the port where the data originates from
         \param buf the buffer to read into
         \param len the size of the buffer to read into
-        \param ip the ip of host where the data originates from
         \return the number of bytes read or SOCKET_ERROR on failure 
     */
-    int socketRecvFrom(int socket, char* buf, int len, IP* ip);
+    int socketRecvFrom(int socket, IP* ip, int* port, char* buf, int len);
     
     /** Close a connectied socket (that was connected with #socketConnect)
         \param socket the socket handle