2019-02-12 18:19:09 +00:00
|
|
|
#ifndef __SERIAL_FILER_H__
|
|
|
|
#define __SERIAL_FILER_H__
|
|
|
|
|
2019-02-14 07:58:51 +00:00
|
|
|
// see https://playground.arduino.cc/Interfacing/LinuxTTY
|
|
|
|
// FIXME: do this in minicom config file
|
2019-02-12 18:19:09 +00:00
|
|
|
class serial_filer: public filer {
|
|
|
|
public:
|
2019-02-14 07:58:51 +00:00
|
|
|
const char *advance();
|
2019-02-14 18:02:26 +00:00
|
|
|
const char *rewind() { _currsp = 0; return advance(); }
|
2019-02-12 18:19:09 +00:00
|
|
|
|
|
|
|
const char *checkpoint();
|
|
|
|
void restore(const char *);
|
|
|
|
|
|
|
|
bool start(const char *);
|
|
|
|
void stop() {}
|
|
|
|
|
|
|
|
uint8_t read();
|
|
|
|
bool more();
|
|
|
|
void write(uint8_t);
|
2019-02-14 18:02:26 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
unsigned _currsp;
|
2019-02-12 18:19:09 +00:00
|
|
|
};
|
|
|
|
#endif
|