Forked version with getIMEI support for AerCloud integration
Dependents: AerCloud_C027_Sample
Fork of C027_Support by
SerialPipe.h
- Committer:
- mazgch
- Date:
- 2013-11-22
- Revision:
- 15:5eda64e5b9d1
- Parent:
- 14:69c3e57ef0f5
- Child:
- 16:4a7ba1887e81
File content as of revision 15:5eda64e5b9d1:
#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); 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; }; // ----------------------------------------------------------------------- #define WAIT -1 #define NOT_FOUND 0 class SerialPipeEx : public SerialPipe { public: SerialPipeEx(PinName tx, PinName rx, int rxSize = 128, int txSize = 128); int getLine(char* buffer, int length); static int getLine(char* buffer, int length, Pipe<char>* pipe); };