Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
SerialBuffered Class Reference
Buffered serial class. More...
#include <SerialBuffered.h>
Public Member Functions | |
| SerialBuffered (PinName tx, PinName rx) | |
| Create a buffered serial class. | |
| virtual | ~SerialBuffered () |
| Destroy. | |
| int | getc () |
| Get a character. | |
| int | readable () |
| Returns 1 if there is a character available to read, 0 otherwise. | |
| void | setTimeout (int ms) |
| Set timeout for getc(). | |
| size_t | readBytes (uint8_t *bytes, size_t requested) |
| Read requested bytes. | |
Detailed Description
Buffered serial class.
Definition at line 7 of file SerialBuffered.h.
Constructor & Destructor Documentation
| SerialBuffered | ( | PinName | tx, |
| PinName | rx | ||
| ) |
Create a buffered serial class.
- Parameters:
-
tx A pin for transmit. rx A pin for receive.
Definition at line 10 of file SerialBuffered.cpp.
| ~SerialBuffered | ( | ) | [virtual] |
Destroy.
Definition at line 20 of file SerialBuffered.cpp.
Member Function Documentation
| int getc | ( | ) |
Get a character.
- Returns:
- A character. (-1:timeout)
Definition at line 58 of file SerialBuffered.cpp.
| int readable | ( | ) |
Returns 1 if there is a character available to read, 0 otherwise.
Definition at line 82 of file SerialBuffered.cpp.
| size_t readBytes | ( | uint8_t * | bytes, |
| size_t | requested | ||
| ) |
Read requested bytes.
- Parameters:
-
bytes A pointer to a buffer. requested Length.
- Returns:
- Readed byte length.
Definition at line 40 of file SerialBuffered.cpp.
| void setTimeout | ( | int | ms ) |
Set timeout for getc().
- Parameters:
-
ms milliseconds. (-1:Disable timeout)
Definition at line 28 of file SerialBuffered.cpp.
Generated on Tue Jul 12 2022 20:39:38 by
1.7.2