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:
9:e7a5959ffae1
Parent:
4:c959dd4c5fe8
Child:
11:b084552b03fe
--- a/GPS.h	Sat Nov 09 13:31:49 2013 +0000
+++ b/GPS.h	Sun Nov 10 16:39:42 2013 +0000
@@ -5,6 +5,9 @@
 #include "SerialPipe.h"
 #include "C027_PinNames.h"
 
+#define RX_SIZE 256
+#define TX_SIZE 128
+
 class GPSParser
 {
 public:
@@ -33,24 +36,23 @@
     static const char toHex[16];
 };
 
-class GPSSerial : public Serial, public GPSParser
+class GPSSerial : public SerialPipe, public GPSParser
 {
 public:
-    GPSSerial(PinName tx = GPSTXD, PinName rx = GPSRXD, int baudrate = GPSBAUD);
-    virtual ~GPSSerial(void);
+    GPSSerial(PinName tx = GPSTXD, PinName rx = GPSRXD, int baudrate = GPSBAUD,
+              int rxSize = RX_SIZE, int txSize = TX_SIZE);
     
     virtual int getMessage(char* buf, int len);
 protected:
-    void serialRxIrq(void);
     virtual char next(void);
     virtual int _send(const void* buf, int len);
-    Pipe<char> _pipe;
 };
 
 class GPSI2C : public I2C, public GPSParser
 {
 public: 
-    GPSI2C(PinName sda = GPSSDA, PinName scl = GPSSCL);
+    GPSI2C(PinName sda = GPSSDA, PinName scl = GPSSCL,
+           int rxSize = RX_SIZE);
     bool detect(void);
     
     virtual int getMessage(char* buf, int len);
@@ -59,6 +61,8 @@
     virtual int sendUbx(unsigned char cls, unsigned char id, const void* buf, int len);
 protected:
     virtual char next(void);
+    bool writeable(void) { return true; }
+    bool putc(int c)     { char ch = c; return send(&ch, 1); }
     virtual int _send(const void* buf, int len);
     int _get(char* buf, int len);                 // read the NMEA or UBX stream