#include <Trace.hh>
|
| Trace () |
|
bool | begin (IOStream::Device *dev, str_P banner=NULL) |
|
bool | end () |
|
void | exitcharacter (char c) |
|
void | fatal (const char *file, int line, str_P expr) |
|
Device * | device () const |
|
Device * | device (Device *dev) |
|
str_P | eol () const |
|
void | eol (str_P s) |
|
str_P | EOL () const |
|
int8_t | width (int8_t value) |
|
uint8_t | precision (uint8_t value) |
|
void | print (int value, Base base=dec) |
|
void | print (long int value, Base base=dec) |
|
void | print (unsigned int value, Base base=dec) |
|
void | print (unsigned long int value, Base base=dec) |
|
void | print (unsigned int value, uint8_t digits, Base base) |
|
void | print (unsigned long int value, uint8_t digits, Base base) |
|
void | print (double value, int8_t width, uint8_t prec) |
|
void | print (uint32_t src, const void *ptr, size_t size, Base base=dec, uint8_t max=16) |
|
void | print (const void *ptr, size_t size, Base base=dec, uint8_t max=16) |
|
void | print (void *ptr) |
|
void | print (const void *ptr) |
|
void | print (char c) |
|
void | print (const char *s) |
|
void | print (str_P s) |
|
void | print (IOStream::Device *buffer) |
|
void | println () |
|
void | vprintf (str_P format, va_list args) |
|
void | printf (str_P format,...) |
|
void | flush () |
|
char * | scan (char *s, size_t count) |
|
char * | readline (char *buf, size_t size, bool echo=true) |
|
IOStream & | operator<< (Manipulator func) |
|
IOStream & | operator<< (int n) |
|
IOStream & | operator<< (long int n) |
|
IOStream & | operator<< (double n) |
|
IOStream & | operator<< (unsigned int n) |
|
IOStream & | operator<< (unsigned long int n) |
|
IOStream & | operator<< (void *ptr) |
|
IOStream & | operator<< (const void *ptr) |
|
IOStream & | operator<< (char c) |
|
IOStream & | operator<< (char *s) |
|
IOStream & | operator<< (const char *s) |
|
IOStream & | operator<< (str_P s) |
|
IOStream & | operator<< (IOStream &buffer) |
|
IOStream & | operator<< (const iovec_t *vec) |
|
|
static char * | ultoa (unsigned long __val, char *__s, int base) |
|
static char * | ltoa (long __val, char *__s, int base) |
|
static char * | utoa (unsigned int __val, char *__s, int base) |
|
static char * | itoa (int __val, char *__s, int base) |
|
|
static const int | EOF = -1 |
|
static const char | CR [] |
|
static const char | LF [] = "\r" |
|
static const char | CRLF [] = "\r\n" |
|
Basic trace support class. Combind IOStream with UART for trace output.
Definition at line 31 of file Trace.hh.
Stream manipulator function prototype. To allow implementation of base change and end of line.
- Parameters
-
- Returns
- iostream.
Definition at line 538 of file IOStream.hh.
Base conversion.
Enumerator |
---|
bcd |
|
bin |
|
oct |
|
dec |
|
hex |
|
Definition at line 43 of file IOStream.hh.
End of line modes.
Enumerator |
---|
CR_MODE |
|
LF_MODE |
|
CRLF_MODE |
|
Definition at line 54 of file IOStream.hh.
Construct Trace IOStream object and initiate with null device. Use begin() to set the trace device. The Trace class is actually a singleton, trace, as the trace macro set depends on the variable.
Definition at line 38 of file Trace.hh.
Start trace stream over given iostream device.
- Parameters
-
[in] | dev | iostream device. |
[in] | banner | trace begin message. |
- Returns
- true(1) if successful otherwise false(0)
Definition at line 28 of file Trace.cpp.
Device* IOStream::device |
( |
| ) |
const |
|
inlineinherited |
Get current device.
- Returns
- device.
Definition at line 265 of file IOStream.hh.
Set io stream device.
- Parameters
-
- Returns
- previous device.
Definition at line 275 of file IOStream.hh.
Stop trace stream over current device.
- Returns
- true(1) if successful otherwise false(0)
Definition at line 52 of file Trace.hh.
str_P IOStream::eol |
( |
| ) |
const |
|
inlineinherited |
Get io stream end of line string.
- Returns
- string for end of line.
Definition at line 286 of file IOStream.hh.
str_P IOStream::EOL |
( |
| ) |
const |
|
inlineinherited |
Get io stream end of line string.
- Returns
- string for end of line.
Definition at line 295 of file IOStream.hh.
void IOStream::eol |
( |
str_P |
s | ) |
|
|
inlineinherited |
Set io stream end of line string.
- Parameters
-
[in] | s | string for end of line. |
Definition at line 304 of file IOStream.hh.
void Trace::exitcharacter |
( |
char |
c | ) |
|
|
inline |
Set exit character to signal fatal to serial monitor.
- Parameters
-
Definition at line 63 of file Trace.hh.
void Trace::fatal |
( |
const char * |
file, |
|
|
int |
line, |
|
|
str_P |
expr |
|
) |
| |
Support function for ASSERT failure. Prints give function name, func, line number and expression that could not be validated to trace output device before calling exit().
- Parameters
-
[in] | file | name. |
[in] | line | number. |
[in] | expr | program memory string with expression. |
Definition at line 39 of file Trace.cpp.
Flush contents of iostream to stream.
Definition at line 504 of file IOStream.hh.
char * IOStream::itoa |
( |
int |
__val, |
|
|
char * |
__s, |
|
|
int |
base |
|
) |
| |
|
staticinherited |
char * IOStream::ltoa |
( |
long |
__val, |
|
|
char * |
__s, |
|
|
int |
base |
|
) |
| |
|
staticinherited |
Output operator for stream manipulator. Apply function.
- Parameters
-
[in] | func | iostream manipulator. |
- Returns
- iostream.
Definition at line 545 of file IOStream.hh.
Print integer as string in the current base to stream. Reset base to decimal.
- Parameters
-
- Returns
- iostream.
Definition at line 556 of file IOStream.hh.
IOStream& IOStream::operator<< |
( |
long int |
n | ) |
|
|
inlineinherited |
Print long integer as string in the current base to stream. Reset base to decimal.
- Parameters
-
- Returns
- iostream.
Definition at line 569 of file IOStream.hh.
IOStream& IOStream::operator<< |
( |
double |
n | ) |
|
|
inlineinherited |
Print double as string with the current field min width and number of decimals. Reset base to decimal.
- Parameters
-
- Returns
- iostream.
Definition at line 583 of file IOStream.hh.
IOStream& IOStream::operator<< |
( |
unsigned int |
n | ) |
|
|
inlineinherited |
Print unsigned integer as string in the current base to stream. Reset base to decimal.
- Parameters
-
- Returns
- iostream.
Definition at line 596 of file IOStream.hh.
IOStream& IOStream::operator<< |
( |
unsigned long int |
n | ) |
|
|
inlineinherited |
Print unsigned long integer as string in the current base to stream. Reset base to decimal.
- Parameters
-
- Returns
- iostream.
Definition at line 609 of file IOStream.hh.
IOStream& IOStream::operator<< |
( |
void * |
ptr | ) |
|
|
inlineinherited |
Print pointer as a hexadecimal number string to stream.
- Parameters
-
- Returns
- iostream.
Definition at line 621 of file IOStream.hh.
IOStream& IOStream::operator<< |
( |
const void * |
ptr | ) |
|
|
inlineinherited |
Print program memory pointer as a hexadecimal number string to stream.
- Parameters
-
[in] | ptr | program memory pointer to print. |
- Returns
- iostream.
Definition at line 634 of file IOStream.hh.
IOStream& IOStream::operator<< |
( |
char |
c | ) |
|
|
inlineinherited |
Print character to stream.
- Parameters
-
- Returns
- iostream.
Definition at line 646 of file IOStream.hh.
IOStream& IOStream::operator<< |
( |
char * |
s | ) |
|
|
inlineinherited |
Print null terminated string to stream.
- Parameters
-
- Returns
- iostream.
Definition at line 657 of file IOStream.hh.
IOStream& IOStream::operator<< |
( |
const char * |
s | ) |
|
|
inlineinherited |
Print null terminated string in program memory to stream.
- Parameters
-
[in] | s | string in program memory to print. |
- Returns
- iostream.
Definition at line 668 of file IOStream.hh.
Print null terminated string in program memory to stream.
- Parameters
-
[in] | s | string in program memory to print. |
- Returns
- iostream.
Definition at line 679 of file IOStream.hh.
Print contents of iobuffer to stream.
- Parameters
-
[in] | buffer | input/output buffer. |
- Returns
- iostream.
Definition at line 690 of file IOStream.hh.
Print contents of iovector to stream.
- Parameters
-
- Returns
- iostream.
Definition at line 701 of file IOStream.hh.
uint8_t IOStream::precision |
( |
uint8_t |
value | ) |
|
|
inlineinherited |
Set number of digits after decimal point for double numbers.
- Parameters
-
- Returns
- previous precision.
Definition at line 327 of file IOStream.hh.
void IOStream::print |
( |
int |
value, |
|
|
Base |
base = dec |
|
) |
| |
|
inherited |
Print integer as string with given base to stream.
- Parameters
-
[in] | value | to print. |
[in] | base | to represent value in (default 10). |
Definition at line 46 of file IOStream.cpp.
void IOStream::print |
( |
long int |
value, |
|
|
Base |
base = dec |
|
) |
| |
|
inherited |
Print long integer 32-bit value in given base torace stream.
- Parameters
-
[in] | value | to print. |
[in] | base | to represent value in (default 10). |
Definition at line 65 of file IOStream.cpp.
void IOStream::print |
( |
unsigned int |
value, |
|
|
Base |
base = dec |
|
) |
| |
|
inherited |
Print unsigned integer as string with given base to stream.
- Parameters
-
[in] | value | to print. |
[in] | base | to represent value in (default 10). |
Definition at line 73 of file IOStream.cpp.
void IOStream::print |
( |
unsigned long int |
value, |
|
|
Base |
base = dec |
|
) |
| |
|
inherited |
Print unsigned long integer 32-bit value in given base to stream.
- Parameters
-
[in] | value | to print. |
[in] | base | to represent value in (default 10). |
Definition at line 81 of file IOStream.cpp.
void IOStream::print |
( |
unsigned int |
value, |
|
|
uint8_t |
digits, |
|
|
Base |
base |
|
) |
| |
|
inherited |
Print unsigned integer as string with given base to stream.
- Parameters
-
[in] | value | to print. |
[in] | digits | to print. |
[in] | base | to represent value in. |
Definition at line 89 of file IOStream.cpp.
void IOStream::print |
( |
unsigned long int |
value, |
|
|
uint8_t |
digits, |
|
|
Base |
base |
|
) |
| |
|
inherited |
Print unsigned long integer 32-bit value in given base to stream.
- Parameters
-
[in] | value | to print. |
[in] | digits | to print. |
[in] | base | to represent value in. |
Definition at line 99 of file IOStream.cpp.
void IOStream::print |
( |
double |
value, |
|
|
int8_t |
width, |
|
|
uint8_t |
prec |
|
) |
| |
|
inherited |
Print double with the minimum field width of the output string (including the '.' and the possible sign for negative values) is given in width, and prec determines the number of digits after the decimal sign. width is signed value, negative for left adjustment.
- Parameters
-
[in] | value | to print. |
[in] | width | minimum field width. |
[in] | prec | number of digits. |
Definition at line 109 of file IOStream.cpp.
void IOStream::print |
( |
uint32_t |
src, |
|
|
const void * |
ptr, |
|
|
size_t |
size, |
|
|
Base |
base = dec , |
|
|
uint8_t |
max = 16 |
|
) |
| |
|
inherited |
Print buffer contents in given base to stream.
- Parameters
-
[in] | src | address prefix. |
[in] | ptr | pointer to data memory. |
[in] | size | number of bytes. |
[in] | base | to represent value in (default 10). |
[in] | max | number of numbers per line (default 16). |
Definition at line 136 of file IOStream.cpp.
void IOStream::print |
( |
const void * |
ptr, |
|
|
size_t |
size, |
|
|
Base |
base = dec , |
|
|
uint8_t |
max = 16 |
|
) |
| |
|
inlineinherited |
Print buffer contents in given base to stream.
- Parameters
-
[in] | ptr | pointer to data memory. |
[in] | size | number of bytes. |
[in] | base | to represent value in (default 10). |
[in] | max | number of numbers per line (default 16). |
Definition at line 408 of file IOStream.hh.
void IOStream::print |
( |
void * |
ptr | ) |
|
|
inlineinherited |
Print pointer as a hexadecimal number to stream.
- Parameters
-
[in] | ptr | pointer to data memory. |
Definition at line 418 of file IOStream.hh.
void IOStream::print |
( |
const void * |
ptr | ) |
|
|
inlineinherited |
Print pointer to program memory as a hexadecimal number to stream.
- Parameters
-
[in] | ptr | pointer to program memory. |
Definition at line 428 of file IOStream.hh.
void IOStream::print |
( |
char |
c | ) |
|
|
inlineinherited |
Print character to stream.
- Parameters
-
Definition at line 437 of file IOStream.hh.
void IOStream::print |
( |
const char * |
s | ) |
|
|
inlineinherited |
Print string in data memory to stream.
- Parameters
-
[in] | s | pointer to data memory string. |
Definition at line 447 of file IOStream.hh.
void IOStream::print |
( |
str_P |
s | ) |
|
|
inlineinherited |
Print string in program memory to stream. Use macro PSTR() to generate a string constants in program memory.
- Parameters
-
[in] | s | pointer to program memory string. |
Definition at line 458 of file IOStream.hh.
Print contents of iostream to stream.
- Parameters
-
[in] | buffer | input/output buffer. |
Definition at line 117 of file IOStream.cpp.
void IOStream::print_prefix |
( |
Base |
base | ) |
|
|
protectedinherited |
Print number prefix for non decimal base.
- Parameters
-
Definition at line 125 of file IOStream.cpp.
void IOStream::printf |
( |
str_P |
format, |
|
|
|
... |
|
) |
| |
|
inlineinherited |
Formated print with variable argument list. The format string should be in program memory. Use the macro PSTR().
- Parameters
-
[in] | format | string in program memory. |
[in] | ... | variable argument list. |
Definition at line 487 of file IOStream.hh.
void IOStream::println |
( |
| ) |
|
|
inlineinherited |
Print end of line to stream.
Definition at line 467 of file IOStream.hh.
char * IOStream::readline |
( |
char * |
buf, |
|
|
size_t |
size, |
|
|
bool |
echo = true |
|
) |
| |
|
inherited |
Read line into the given buffer. Characters received from the device is appended to the end of the string until end of line is received. The buffer pointer is returned with a complete line has been received otherwise NULL. The function will append until the given size of reached.
- Parameters
-
[in] | buf | buffer for received line. |
[in] | size | of buffer. |
[in] | echo | character mode (Default true). |
- Returns
- NULL or pointer to buffer when line received.
Definition at line 262 of file IOStream.cpp.
char * IOStream::scan |
( |
char * |
s, |
|
|
size_t |
count |
|
) |
| |
|
inherited |
Scan next token from the input stream. Returns pointer to string or NULL if not stream is empty.
- Parameters
-
[in] | s | string buffer to read into. |
[in] | count | max number of bytes to read. |
- Returns
- string pointer or NULL.
Definition at line 224 of file IOStream.cpp.
char * IOStream::ultoa |
( |
unsigned long |
__val, |
|
|
char * |
__s, |
|
|
int |
base |
|
) |
| |
|
staticinherited |
char * IOStream::utoa |
( |
unsigned int |
__val, |
|
|
char * |
__s, |
|
|
int |
base |
|
) |
| |
|
staticinherited |
void IOStream::vprintf |
( |
str_P |
format, |
|
|
va_list |
args |
|
) |
| |
|
inherited |
Format print with variable argument list. The format string should be in program memory. Use the macro PSTR().
- Parameters
-
[in] | format | string in program memory. |
[in] | args | variable argument list. |
Definition at line 163 of file IOStream.cpp.
int8_t IOStream::width |
( |
int8_t |
value | ) |
|
|
inlineinherited |
Set minimum width for double numbers. The width is signed value, negative for left adjustment.
- Parameters
-
- Returns
- previous width.
Definition at line 315 of file IOStream.hh.
const size_t IOStream::BUF_MAX = sizeof(uint32_t) * CHARBITS + 1 |
|
staticprotectedinherited |
Maximum size of required buffer for string conversion.
Definition at line 730 of file IOStream.hh.
const char IOStream::CR[] |
|
staticinherited |
End Of Line character sequences
Definition at line 36 of file IOStream.hh.
const char IOStream::CRLF = "\r\n" |
|
staticinherited |
const int IOStream::EOF = -1 |
|
staticinherited |
End Of File, returned when device operations fails (empty or full).
Definition at line 33 of file IOStream.hh.
char Trace::EXITCHARACTER |
|
protected |
Exit from serial monitor, miniterm. Default CTRL-ALT GR-] (0x1d)
Definition at line 84 of file Trace.hh.
const char IOStream::LF = "\r" |
|
staticinherited |
Base for next output operator.
Definition at line 724 of file IOStream.hh.
End of line string (program memory).
Definition at line 727 of file IOStream.hh.
Number of digits after decimal sign.
Definition at line 726 of file IOStream.hh.
Minimum width of output string.
Definition at line 725 of file IOStream.hh.
Result of latest MEASURE (in micro-seconds).
Definition at line 80 of file Trace.hh.
The documentation for this class was generated from the following files: