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.

SerialPipe.h

Committer:
mazgch
Date:
2014-03-24
Revision:
19:2b5d097ca15d
Parent:
18:e5697801df29
Child:
35:9275215a3a5b

File content as of revision 19:2b5d097ca15d:

#pragma once 

#include "mbed.h"
#include "Pipe.h"

#define _SerialPipeBase SerialBase

class SerialPipe : public _SerialPipeBase
{
public:
    SerialPipe(PinName tx, PinName rx, int rxSize = 128, int txSize = 128);
#if DEVICE_SERIAL_FC
    SerialPipe(PinName tx, PinName rx, PinName rts, PinName cts, int rxSize = 128, int txSize = 128);
#endif
    virtual ~SerialPipe(void);
    // tx channel
    int writeable(void);
    int putc(int c); // blocking
    int put(const void* buffer, int length, bool blocking);
    // rx channel
    int readable(void);
    int getc(void); // blocking
    int get(void* buffer, int length, bool blocking);
protected:
    void rxIrqBuf(void);
    void txIrqBuf(void);
    void txStart(void);
    Pipe<char> _pipeRx;
    Pipe<char> _pipeTx;
};