Provides debug output to stream (e.g. Serial) or delegate function handler. More...

#include <Debug.h>

Inheritance diagram for DebugClass:
[legend]
Collaboration diagram for DebugClass:
[legend]

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...
 
- Public Member Functions inherited from Print
virtual ~Print ()
 
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 c)
 Prints a single character to output stream. More...
 
size_t print (const char str[])
 Prints a c-string to output stream. More...
 
size_t print (double num, int digits=2)
 Print a floating-point 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 ()
 Prints a newline to output stream. More...
 
size_t println (const char str[])
 Prints a c-string to output stream, appending newline. More...
 
size_t println (char c)
 Prints a single character to output stream, appending newline. More...
 
size_t println (double num, int digits=2)
 Print a floating-point 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,...) __attribute__((format(printf
 Prints a formatted c-string to output stream. More...
 
size_t print (unsigned long num, int base=DEC)
 
size_t print (const unsigned long long &num, int base=DEC)
 
size_t print (long, int base=DEC)
 
size_t print (const long long &, int base=DEC)
 
size_t print (unsigned int num, int base=DEC)
 
size_t print (unsigned char num, int base=DEC)
 
size_t print (int num, int base=DEC)
 
size_t println (unsigned char num, int base=DEC)
 
size_t println (unsigned int num, int base=DEC)
 
size_t println (unsigned long num, int base=DEC)
 
size_t println (const unsigned long long &num, int base=DEC)
 
size_t println (int num, int base=DEC)
 
size_t println (long num, int base=DEC)
 
size_t println (const long long &num, int base=DEC)
 

Additional Inherited Members

- Protected Member Functions inherited from Print
void setWriteError (int err=1)
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ DebugClass()

DebugClass::DebugClass ( )

Instantiate a debug object.

Note
Default output is Serial stream

Member Function Documentation

◆ initCommand()

void DebugClass::initCommand ( )

Enable control of debug output from CLI command handler output.

◆ setDebug() [1/2]

void DebugClass::setDebug ( DebugPrintCharDelegate  reqDelegate)

Configure debug to use delegate handler for its output.

Parameters
reqDelegateFunction to handle debug output
Note
Disables stream output

◆ setDebug() [2/2]

void DebugClass::setDebug ( Stream reqStream)

Configures debug to use stream for its output.

Parameters
reqStreamStream for debug output
Note
Disables delegate handler

◆ start()

void DebugClass::start ( )

Start debug output.

◆ status()

bool DebugClass::status ( )
inline

Get debug status.

Return values
boolTrue if debug enabled

◆ stop()

void DebugClass::stop ( )

Stop debug output.

◆ write()

size_t DebugClass::write ( uint8_t  c)
overridevirtual

Writes a single character to output stream.

Parameters
cCharacter to write to output stream
Return values
size_tQuantity of characters written to output stream

Implements Print.


The documentation for this class was generated from the following file: