Class to manage the print of the messages.
More...
#include <HkxCommunication.h>
|
| HkxPrint () |
| Default constructor. More...
|
|
| HkxPrint (HardwareSerial &serialPrint, long baudrate) |
| Active constructor with default values. More...
|
|
| HkxPrint (HardwareSerial &serialPrint, long baudrate, bool errorMessages, bool warningMessages, bool infoMessages) |
| Active constructor. More...
|
|
| HkxPrint (HkxPrint hkxPrint, bool errorMessages, bool warningMessages, bool infoMessages) |
| Copy constructor. More...
|
|
void | errorPrint (const String &message) const |
| Print error. More...
|
|
void | warningPrint (const String &message) const |
| Print warning. More...
|
|
void | infoPrint (const String &message) const |
| Print info. More...
|
|
Class to manage the print of the messages.
This class manages the print of the messages (error, warning and info) for a serial monitor.
Default constructor.
The default constructor is used when no messages should be (user decision) or can be (for certain Arduino boards) sent.
Example for void print communication:
HkxPrint::HkxPrint |
( |
HardwareSerial & |
serialPrint, |
|
|
long |
baudrate |
|
) |
| |
|
inline |
Active constructor with default values.
The active constructor with default values setup the serial communication for only error messages.
- Parameters
-
[in] | serialPrint | : Serial port to use to send the messages. It will be most ot the time Serial . |
[in] | baudrate | : value of the bauderate to send the messages. The same value shall be setup for the serial monitor. |
Example to display only error messages over Serial
port:
HkxPrint::HkxPrint |
( |
HardwareSerial & |
serialPrint, |
|
|
long |
baudrate, |
|
|
bool |
errorMessages, |
|
|
bool |
warningMessages, |
|
|
bool |
infoMessages |
|
) |
| |
|
inline |
Active constructor.
The active constructor setup the serial communication and the type of messages to send (error, warning and info).
- Parameters
-
[in] | serialPrint | : Serial port to use to send the messages. It will be most ot the time Serial . |
[in] | baudrate | : value of the bauderate to send the messages. The same value shall be setup for the serial monitor. |
[in] | errorMessages | : set true to display error messages, false otherwise. |
[in] | warningMessages | : set true to display warning messages, false otherwise. |
[in] | infoMessages | : set true to display info messages, false otherwise. |
Example to display error and warning messages (but not info) over Serial
port:
HkxPrint::HkxPrint |
( |
HkxPrint |
hkxPrint, |
|
|
bool |
errorMessages, |
|
|
bool |
warningMessages, |
|
|
bool |
infoMessages |
|
) |
| |
|
inline |
Copy constructor.
The copy constructor copy the serial communication from reference hkxPrint, and setup the type of messages to send (error, warning and info).
- Parameters
-
[in] | hkxPrint | : Reference HkxPrint for the copy. |
[in] | errorMessages | : set true to display error messages, false otherwise. |
[in] | warningMessages | : set true to display warning messages, false otherwise. |
[in] | infoMessages | : set true to display info messages, false otherwise. |
Example to copy print1
(that display only errors) but display error, warning and info messages over Serial
port:
void HkxPrint::errorPrint |
( |
const String & |
message | ) |
const |
|
inline |
Print error.
Print an error message if setup.
- Parameters
-
[in] | message | : content to print as an error. |
Example:
void HkxPrint::infoPrint |
( |
const String & |
message | ) |
const |
|
inline |
Print info.
Print an info message if setup.
- Parameters
-
[in] | message | : content to print as an info. |
Example:
void HkxPrint::warningPrint |
( |
const String & |
message | ) |
const |
|
inline |
Print warning.
Print a warning message if setup.
- Parameters
-
[in] | message | : content to print as a warning. |
Example:
const boolean HkxPrint::_errorMessages |
const boolean HkxPrint::_infoMessages |
Stream* const HkxPrint::_serialPrint |
Serial port to print messages
const boolean HkxPrint::_warningMessages |
The documentation for this class was generated from the following file: