1 #ifndef BUFSERIAL_H_LOADED
2 #define BUFSERIAL_H_LOADED 1
11 extern UARTClass Serial;
17 #define ITEM_INVALID 3
40 #define SERIALBUFSIZ 128
89 enum { unknown, comment, non_comment } line_type;
91 void print_simple_float(
const float f,
const int dp);
92 void print_float(
const float f,
const int dp=3);
93 void print_string(
const char* s);
94 void print_int(
const int i,
const int base);
95 void append_byte(
const byte);
113 void display_serial_contents(
void);
114 static void testenv_logprintf(PGM_P format, ...);
int count_discarded(void)
Return the number of bytes discarded since the last call to this method.
Definition: buffered-serial.cpp:548
int read_items_read_char(void)
Read a character from Serial, and return the number of bytes actually read.
Definition: buffered-serial.cpp:167
InputItem * read_items_get(int *n)
Retrieve items from the Serial input.
Definition: buffered-serial.cpp:81
The BufferedSerial class mediates access to an underlying serial device.
Definition: buffered-serial.h:87
void init(void)
Initialise the buffered-serial object, after the program is under way.
Definition: buffered-serial.cpp:38
BufferedSerial()
Create a new BufferedSerial object, and initialise the underlying serial port.
Definition: buffered-serial.cpp:26
void logprintf(PGM_P format,...)
The logprintf function supports a simple printf-like syntax for writing data to the Serial port...
Definition: buffered-serial.cpp:299
int putchar(const int)
Append a single byte to the output.
Definition: buffered-serial.cpp:536
void read_items_reset(void)
Reset the buffer of read items.
Definition: buffered-serial.cpp:95
void logvprintf(PGM_P format, va_list ap)
The logvprintf is the varargs companion to the logprintf function.
Definition: buffered-serial.cpp:325
bool read_available(void)
Return true if there is at least one byte available to be read.
Definition: buffered-serial.cpp:267