Sming Framework API
Sming - Open Source framework for high efficiency WiFi SoC ESP8266 native development with C++ language.
|
Provides debug output to stream (e.g. Serial) or delegate function handler. More...
#include <Debug.h>
Public Member Functions | |
DebugClass () | |
Instantiate a debug object. More... | |
void | initCommand () |
Enable control of debug output from CLI command handler output. More... | |
void | start () |
Start debug output. More... | |
void | stop () |
Stop debug output. More... | |
bool | status () |
Get debug status. More... | |
void | setDebug (DebugPrintCharDelegate reqDelegate) |
Configure debug to use delegate handler for its output. More... | |
void | setDebug (Stream &reqStream) |
Configures debug to use stream for its output. More... | |
size_t | write (uint8_t) override |
Writes a single character to output stream. More... | |
int | getWriteError () |
Gets last error. More... | |
void | clearWriteError () |
Clears the last write error. More... | |
size_t | write (const char *str) |
Writes a c-string to output stream. More... | |
virtual size_t | write (const uint8_t *buffer, size_t size) |
Writes characters from a buffer to output stream. More... | |
size_t | write (const char *buffer, size_t size) |
Writes characters from a buffer to output stream. More... | |
size_t | print (char) |
Prints a single character to output stream. More... | |
size_t | print (const char[]) |
Prints a c-string to output stream. More... | |
size_t | print (unsigned long, int base=DEC) |
Prints a number to output stream. More... | |
size_t | print (long, int base=DEC) |
Prints a number to output stream. More... | |
size_t | print (unsigned int, int base=DEC) |
size_t | print (unsigned char, int base=DEC) |
size_t | print (int, int base=DEC) |
Prints a number to output stream. More... | |
size_t | print (double, int digits=2) |
Prints number to output stream. More... | |
size_t | print (const Printable &p) |
Prints a Printable object to output stream. More... | |
size_t | print (const String &s) |
Prints a String to output stream. More... | |
size_t | println (void) |
Prints a newline to output stream. More... | |
size_t | println (const char[]) |
Prints a c-string to output stream, appending newline. More... | |
size_t | println (char) |
Prints a single character to output stream, appending newline. More... | |
size_t | println (unsigned char, int base=DEC) |
Prints a number to output stream, appending newline. More... | |
size_t | println (unsigned int, int base=DEC) |
size_t | println (unsigned long, int base=DEC) |
size_t | println (int, int base=DEC) |
Prints a number to output stream, appending newline. More... | |
size_t | println (long, int base=DEC) |
Prints a number to output stream, appending newline. More... | |
size_t | println (double, int digits=2) |
Prints a number to output stream, appending newline. More... | |
size_t | println (const Printable &p) |
Prints a Printable object to output stream, appending newline. More... | |
size_t | println (const String &s) |
Prints a String to output stream, appending newline. More... | |
size_t | printf (const char *fmt,...) |
Prints a formatted c-string to output stream. More... | |
Protected Member Functions | |
void | setWriteError (int err=1) |
Provides debug output to stream (e.g. Serial) or delegate function handler.
Debug output may be prefixed with an elapsed timestamp. Use standard print methods to produce debug output. Sming CLI (command handler) may be enabled to provide control of debug output to end user.
DebugClass::DebugClass | ( | ) |
Instantiate a debug object.
|
inlineinherited |
Clears the last write error.
|
inlineinherited |
Gets last error.
int | Error number of last write error |
void DebugClass::initCommand | ( | ) |
Enable control of debug output from CLI command handler output.
|
inherited |
Prints a single character to output stream.
size_t | Quantity of characters written to stream |
|
inherited |
Prints a c-string to output stream.
char[] | c-string to print |
size_t | Quantity of characters written to output stream |
size_t | Quantity of characters written to stream |
|
inherited |
Prints a number to output stream.
unsigned long | Number to print |
base | The base for output (Default: Decimal (base 10)) |
size_t | Quantity of characters written to stream |
unsigned int | Number to print |
base | The base for output (Default: Decimal (base 10)) |
size_t | Quantity of characters written to stream |
unsigned char | Number to print |
base | The base for output (Default: Decimal (base 10)) |
size_t | Quantity of characters written to stream |
|
inherited |
Prints a number to output stream.
long | Number to print |
base | The base for output (Default: Decimal (base 10)) |
size_t | Quantity of characters written to stream |
|
inherited |
Prints a number to output stream.
int | Number to print |
base | The base for output (Default: Decimal (base 10)) |
size_t | Quantity of characters written to stream |
|
inherited |
Prints number to output stream.
Prints a number to output stream.
double | Number to print |
int | Decimal places to show |
size_t | Quantity of characters written to output stream |
double | Number to print |
digits | The decimal places to print (Default: 2, e.g. 21.35) |
size_t | Quantity of characters written to stream |
|
inherited |
Prints a Printable object to output stream.
p | Object to print |
size_t | Quantity of characters written to stream |
|
inherited |
|
inherited |
Prints a formatted c-string to output stream.
fmt | Pointer to formated c-string to print |
... | Parameters for placeholders within formated string |
size_t | Quantity of characters written to stream |
|
inherited |
Prints a newline to output stream.
Prints | newline to output stream |
size_t | Quantity of characters written to output stream |
size_t | Quantity of characters written to stream |
|
inherited |
Prints a c-string to output stream, appending newline.
char[] | c-string to print |
size_t | Quantity of characters written to stream |
|
inherited |
Prints a single character to output stream, appending newline.
char | Character to print |
size_t | Quantity of characters written to stream |
|
inherited |
Prints a number to output stream, appending newline.
unsigned char | Number to print |
base | The base for output (Default: Decimal (base 10)) |
size_t | Quantity of characters written to stream |
unsigned int | Number to print |
base | The base for output (Default: Decimal (base 10)) |
size_t | Quantity of characters written to stream |
unsigned long | Number to print |
base | The base for output (Default: Decimal (base 10)) |
size_t | Quantity of characters written to stream |
|
inherited |
Prints a number to output stream, appending newline.
int | Number to print |
base | The base for output (Default: Decimal (base 10)) |
size_t | Quantity of characters written to stream |
|
inherited |
Prints a number to output stream, appending newline.
long | Number to print |
base | The base for output (Default: Decimal (base 10)) |
size_t | Quantity of characters written to stream |
|
inherited |
Prints a number to output stream, appending newline.
double | Number to print |
digits | The decimal places to print (Default: 2, e.g. 21.35) |
size_t | Quantity of characters written to stream |
|
inherited |
Prints a Printable object to output stream, appending newline.
p | Object to print |
size_t | Quantity of characters written to stream |
|
inherited |
void DebugClass::setDebug | ( | DebugPrintCharDelegate | reqDelegate | ) |
Configure debug to use delegate handler for its output.
reqDelegate | Function to handle debug output |
void DebugClass::setDebug | ( | Stream & | reqStream | ) |
Configures debug to use stream for its output.
reqStream | Stream for debug output |
void DebugClass::start | ( | ) |
Start debug output.
|
inline |
Get debug status.
bool | True if debug enabled |
void DebugClass::stop | ( | ) |
Stop debug output.
|
inlineinherited |
Writes a c-string to output stream.
str | Pointer to c-string |
size_t | Quantity of characters written to stream |
|
virtualinherited |
Writes characters from a buffer to output stream.
buffer | Pointer to character buffer |
size | Quantity of characters to write |
size_t | Quantity of characters written to stream |
Reimplemented in HardwareSerial, CircularBuffer, FileStream, MemoryDataStream, LimitedMemoryStream, TwoWire, EndlessMemoryStream, GdbFileStream, rBootItemOutputStream, and ReadWriteStream.
|
inlineinherited |
Writes characters from a buffer to output stream.
buffer | Pointer to character buffer |
size | Quantity of characters to write |
size_t | Quantity of characters written to stream |
|
overridevirtual |
Writes a single character to output stream.
uint8_t | Character to write to output stream |
size_t | Quantity of characters written to output stream |
Implements Print.