uitgy
Dependents: App_Pese_Ruche_SYSBEE
Fork of C027_Support by
Diff: MDM.h
- Revision:
- 101:edfeb8af206e
- Parent:
- 98:c786461edd40
- Child:
- 103:197fa7920ad8
--- a/MDM.h Tue Jul 01 05:46:06 2014 +0000 +++ b/MDM.h Tue Jul 01 06:41:26 2014 +0000 @@ -409,6 +409,10 @@ */ virtual int getLine(char* buf, int len) = 0; + /* clear the pending input data + */ + virtual void purge(void) = 0; + /** Write data to the device \param buf the buffer to write \param buf size of the buffer to write @@ -596,6 +600,13 @@ NOT_FOUND if nothing was found */ virtual int getLine(char* buffer, int length); + + /* clear the pending input data */ + virtual void purge(void) + { + while (readable()) + getc(); + } protected: /** Write bytes to the physical interface. \param buf the buffer to write @@ -617,6 +628,7 @@ //! Destructor virtual ~MDMUsb(void); virtual int getLine(char* buffer, int length); + virtual void purge(void) { } protected: virtual int _send(const void* buf, int len); };