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:
42:6786401ba18c
Parent:
35:9275215a3a5b
Child:
70:0a87d256cd24
diff -r b94a1f410e71 -r 6786401ba18c SerialPipe.h
--- a/SerialPipe.h	Fri Apr 11 19:41:05 2014 +0000
+++ b/SerialPipe.h	Fri Apr 11 19:53:53 2014 +0000
@@ -3,25 +3,76 @@
 #include "mbed.h"
 #include "Pipe.h"
 
-#define _SerialPipeBase SerialBase
+#define _SerialPipeBase SerialBase //!< base class used by this class
 
+/** Buffered serial interface (rtos capable/interrupt driven)
+*/
 class SerialPipe : public _SerialPipeBase
 {
 public:
+    /** Constructor
+        \param tx the trasmitting pin
+        \param rx the receiving pin
+        \param rxSize the size of the receiving buffer
+        \param txSize the size of the transmitting buffer
+    */
     SerialPipe(PinName tx, PinName rx, int rxSize = 128, int txSize = 128);
-    virtual ~SerialPipe(void);
+    
+    /** Destructor
+    */
+    ~SerialPipe(void);
+    
     // tx channel
+    //----------------------------------------------------
+    
+    /** check if writable 
+        return the number of free bytes
+    */
     int writeable(void);
-    int putc(int c); // blocking
+    
+    /** send a character (blocking)
+        \param c the character to send
+        \return c
+    */
+    int putc(int c);
+    
+    /** send a buffer
+        \param buffer the buffer to send
+        \param length the size of the buffer to send
+        \param blocking, if true this function will block 
+               until all bytes placed in the buffer. 
+        \return the number of bytes written 
+    */
     int put(const void* buffer, int length, bool blocking);
+    
     // rx channel
+    //----------------------------------------------------
+    
+    /** check if readable
+        \return the size available in the buffer.
+    */
     int readable(void);
-    int getc(void); // blocking
+    
+    /** receive one character from the serial port (blocking)
+        \param the character received 
+    */
+    int getc(void);
+    
+    /** read a buffer from the serial port
+        \param pointer to the buffer to read.
+        \param length number of bytes to read 
+        \param blocking true if all bytes shall be read. false if only the available bytes.
+        \return the number of bytes read.
+    */
     int get(void* buffer, int length, bool blocking);
+    
 protected:
+    //! receive interrupt routine
     void rxIrqBuf(void);
+    //! transmit interrupt woutine 
     void txIrqBuf(void);
+    //! start transmission helper
     void txStart(void);
-    Pipe<char> _pipeRx;
-    Pipe<char> _pipeTx;
+    Pipe<char> _pipeRx; //!< receive pipe
+    Pipe<char> _pipeTx; //!< transmit pipe
 };