DebugClass Class Reference
Provides debug output to stream (e.g. Serial) or delegate function handler. More...
#include <Debug.h>
Inheritance diagram for DebugClass:
Collaboration diagram for DebugClass:
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... | |
| template<typename T > | |
| std::enable_if< has_printTo< T >::value, size_t >::type | print (const T &obj) |
| Prints a Printable object to output stream. More... | |
| size_t | print (const String &s) |
| Prints a String to output stream. More... | |
| template<typename E > | |
| std::enable_if< std::is_enum< E >::value &&!std::is_convertible< E, int >::value, size_t >::type | print (E value) |
enums can be printed as strings provided they have a toString(E) implementation. More... | |
| size_t | println () |
| Prints a newline to output stream. More... | |
| template<typename... Args> | |
| size_t | println (const Args &... args) |
| Print value plus newline to output stream. More... | |
| size_t | printf (const char *fmt,...) |
| Prints a formatted c-string to output stream. More... | |
| size_t | print (unsigned long num, uint8_t base=DEC) |
| template<typename... Args> | |
| size_t | print (unsigned long num, Args... args) |
| template<typename... Args> | |
| size_t | print (const unsigned long long &num, Args... args) |
| size_t | print (long num, uint8_t base=DEC) |
| template<typename... Args> | |
| size_t | print (long num, Args... args) |
| template<typename... Args> | |
| size_t | print (const long long &num, Args... args) |
| template<typename... Args> | |
| size_t | print (unsigned int num, Args... args) |
| template<typename... Args> | |
| size_t | print (unsigned char num, Args... args) |
| template<typename... Args> | |
| size_t | print (int num, Args... args) |
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
-
reqDelegate Function 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
-
reqStream Stream for debug output
- Note
- Disables delegate handler
◆ start()
| void DebugClass::start | ( | ) |
Start debug output.
◆ status()
|
inline |
Get debug status.
- Return values
-
bool True if debug enabled
◆ stop()
| void DebugClass::stop | ( | ) |
Stop debug output.
◆ write()
Writes a single character to output stream.
- Parameters
-
c Character to write to output stream
- Return values
-
size_t Quantity of characters written to output stream
Implements Print.
The documentation for this class was generated from the following file:
Public Member Functions inherited from
1.8.13