The stream class is derived from this class. This class contains methods, that are used for to print formatted output.
More...
#include <Print.h>
|
| Print () |
| Constructor. More...
|
|
int | getWriteError () |
| Gets write error. More...
|
|
void | clearWriteError () |
| Clears write error. More...
|
|
virtual size_t | write (uint8_t byte)=0 |
| Writes one unsigned byte (character). More...
|
|
size_t | write (const char *str) |
| Writes character array (string). More...
|
|
virtual size_t | write (const uint8_t *buffer, size_t size) |
| Writes byte array (string). More...
|
|
size_t | write (const char *buffer, size_t size) |
| Writes character array (string). More...
|
|
| __INTEGER_ONLY__ (T, size_t) inline write(T val) |
| Converts integer type variable to unsigned byte and writes it. More...
|
|
virtual int | availableForWrite () |
| Gets how many bytes can be written, meaning "a single write may block". More...
|
|
size_t | printf (const char *format,...) __attribute__((format(printf |
| Prints formatted data. More...
|
|
size_t size_t | print (const String &s) |
| Prints string. More...
|
|
size_t | print (const char str[]) |
| Prints character array (string). More...
|
|
size_t | print (char c) |
| Prints one character. More...
|
|
| __SIGNED_INTEGER_ONLY__ (T, size_t) print(T n |
| Converts integer number to character array and prints it. More...
|
|
size_t | println (const String &s) |
| Prints string followed by carriage return and new line. More...
|
|
size_t | println (const char[]) |
| Prints character array (string) followed by carriage return and new line. More...
|
|
size_t | println (char) |
| Prints one character followed by carriage return and new line. More...
|
|
| __INTEGER_ONLY__ (T, size_t) inline println(T n |
| Converts integer number to character array followed by carriage return and new line and prints it. More...
|
|
size_t | println (void) |
| Prints carriage return and new line. More...
|
|
template<class T > |
Print & | operator<< (T value) |
| This operator (<<) applied to an output stream is known as insertion operator, it can be used same as cout<< operator. More...
|
|
The stream class is derived from this class. This class contains methods, that are used for to print formatted output.
- See also
- Print.h
-
Printable
-
Stream
◆ Print()
◆ setWriteError()
void Print::setWriteError |
( |
int |
err = 1 | ) |
|
|
inlineprotected |
◆ getWriteError()
int Print::getWriteError |
( |
| ) |
|
|
inline |
Gets write error.
- Returns
- Returns write error.
- Note
- Does not works in HardwareSerial right now!
◆ clearWriteError()
void Print::clearWriteError |
( |
| ) |
|
|
inline |
◆ write() [1/4]
virtual size_t Print::write |
( |
uint8_t |
byte | ) |
|
|
pure virtual |
Writes one unsigned byte (character).
- Parameters
-
byte | Byte you want to write. |
- Returns
- Returns count of successfully written bytes.
Implemented in HardwareI2C, and HardwareSerial.
◆ write() [2/4]
size_t Print::write |
( |
const char * |
str | ) |
|
|
inline |
Writes character array (string).
- Parameters
-
str | String you want to write. |
- Note
- String you want to write have to ends with \0, else it can cause unexpected errors.
- Returns
- Returns count of successfully written bytes (characters).
◆ write() [3/4]
size_t Print::write |
( |
const uint8_t * |
buffer, |
|
|
size_t |
size |
|
) |
| |
|
virtual |
Writes byte array (string).
- Parameters
-
buffer | Data you want to write. |
size | Size of buffer (length of data). |
- Returns
- Returns count of successfully written bytes.
Reimplemented in HardwareSerial, and HardwareI2C.
◆ write() [4/4]
size_t Print::write |
( |
const char * |
buffer, |
|
|
size_t |
size |
|
) |
| |
|
inline |
Writes character array (string).
- Parameters
-
buffer | Data you want to write. |
size | Size of buffer (length of data). |
- Returns
- Returns count of successfully written bytes (characters).
◆ __INTEGER_ONLY__() [1/2]
Print::__INTEGER_ONLY__ |
( |
T |
, |
|
|
size_t |
|
|
) |
| |
|
inline |
Converts integer type variable to unsigned byte and writes it.
- Note
- These handle ambiguity for write(0) case, because (0) can be a pointer or an integer.
- Parameters
-
val | Integer type variable, that will be converted to unsigned byte and will be written. |
- Returns
- Returns count of successfully written bytes (characters).
◆ availableForWrite()
virtual int Print::availableForWrite |
( |
| ) |
|
|
inlinevirtual |
Gets how many bytes can be written, meaning "a single write may block".
Default set to INT16_MAX.
- Note
- Should be overriden by subclasses with buffering.
- Returns
- Returns how many bytes can be written or INT16_MAX if not implemented.
◆ printf()
size_t Print::printf |
( |
const char * |
format, |
|
|
|
... |
|
) |
| |
◆ print() [1/3]
size_t size_t Print::print |
( |
const String & |
s | ) |
|
Prints string.
- Parameters
-
- Returns
- Returns count of successfully written bytes (characters).
◆ print() [2/3]
size_t Print::print |
( |
const char |
str[] | ) |
|
Prints character array (string).
- Parameters
-
str | String you want to write. |
- Note
- String you want to write have to ends with \0, else it can cause unexpected errors.
- Returns
- Returns count of successfully written bytes (characters).
◆ print() [3/3]
size_t Print::print |
( |
char |
c | ) |
|
Prints one character.
- Parameters
-
c | Character you want to write. |
- Returns
- Returns count of successfully written bytes (characters).
◆ __SIGNED_INTEGER_ONLY__()
Print::__SIGNED_INTEGER_ONLY__ |
( |
T |
, |
|
|
size_t |
|
|
) |
| |
Converts integer number to character array and prints it.
- Parameters
-
n | Integer number, you want to convert to character array and print. |
base | Base, in what will be the number displayed. Use (DEC, HEX, OCT, BIN) |
- Returns
- Returns count of successfully written bytes (characters).
◆ println() [1/4]
size_t Print::println |
( |
const String & |
s | ) |
|
Prints string followed by carriage return and new line.
- Parameters
-
- Returns
- Returns count of successfully written bytes (characters) including carriage return and new line characters.
◆ println() [2/4]
size_t Print::println |
( |
const char |
c[] | ) |
|
Prints character array (string) followed by carriage return and new line.
- Parameters
-
str | String you want to write. |
- Note
- String you want to write have to ends with \0, else it can cause unexpected errors.
- Returns
- Returns count of successfully written bytes (characters) including carriage return and new line characters.
◆ println() [3/4]
size_t Print::println |
( |
char |
c | ) |
|
Prints one character followed by carriage return and new line.
- Parameters
-
c | Character you want to write. |
- Returns
- Returns count of successfully written bytes (characters) including carriage return and new line characters.
◆ __INTEGER_ONLY__() [2/2]
Print::__INTEGER_ONLY__ |
( |
T |
, |
|
|
size_t |
|
|
) |
| |
Converts integer number to character array followed by carriage return and new line and prints it.
- Parameters
-
n | Integer number, you want to convert to character array and print. |
base | Base, in what will be the number displayed. Use (DEC, HEX, OCT, BIN) |
- Returns
- Returns count of successfully written bytes (characters) including carriage return and new line characters.
◆ println() [4/4]
size_t Print::println |
( |
void |
| ) |
|
Prints carriage return and new line.
- Returns
- Returns count of successfully written bytes (characters) including carriage return and new line characters.
◆ operator<<()
template<class T >
Print& Print::operator<< |
( |
T |
value | ) |
|
|
inline |
This operator (<<) applied to an output stream is known as insertion operator, it can be used same as cout<< operator.
- Parameters
-
obj | Printing stream. |
arg | Value, that will be printed. |
- Returns
- Returns printing stream.
- Note
- This operator is same as calling print() method, but with different return type.
◆ base
The documentation for this class was generated from the following files: