theCore C++ embedded framework
|
Console pipe (blocking) adapter. More...
#include </home/travis/build/forGGe/theCore/dev/bus/export/dev/console_pipe.hpp>
Public Member Functions | |
console_pipe () | |
Constructs a pipe. More... | |
~console_pipe () | |
Destructs a pipe. More... | |
ecl::err | init () |
Inits a pipe. More... | |
ssize_t | write (const uint8_t *data, size_t count) |
Writes a data to a pipe. More... | |
ssize_t | read (uint8_t *buffer, size_t size) |
Reads a data from a pipe. More... | |
ecl::err | last_error () const |
Gets last error occurred. More... | |
Console pipe (blocking) adapter.
This adapter provides functionality of a blocking pipe built over generic bus interface. It echoes each byte received. Temporary solution, until 'serial' driver will be supported in each platform.
GBus | Generic bus driver. |
ecl::console_pipe< GBus >::console_pipe | ( | ) |
Constructs a pipe.
ecl::console_pipe< GBus >::~console_pipe | ( | ) |
Destructs a pipe.
ecl::err ecl::console_pipe< GBus >::init | ( | ) |
Inits a pipe.
Lazy initialization. Inits a bus.
ssize_t ecl::console_pipe< GBus >::write | ( | const uint8_t * | data, |
size_t | count | ||
) |
Writes a data to a pipe.
If error is occurred before transfer has started then this method will immediately exit and return negative integer value to notify about error. If error occur during transaction then return value will be less than bytes requested or zero, indicating amount of bytes that were successfully written to a pipe. Last error can be obtained via
[in] | data | Data to write. Must not be null. |
[in] | count | Count of bytes that must be written to a pipe. Can be zero. |
ssize_t ecl::console_pipe< GBus >::read | ( | uint8_t * | buffer, |
size_t | size | ||
) |
Reads a data from a pipe.
If error is occurred before transfer has started then this method will immediately exit and return negative integer value to notify about error. If error occur during transaction or there is less data than request then return value will be less than size of provided buffer, indicating amount of bytes that were successfully read from a pipe. Last error can be obtained via
[out] | buffer | Data buffer to read to. Must not be null. |
[in] | size | Size of a buffer. Can be zero. |
err ecl::console_pipe< GBus >::last_error | ( | ) | const |
Gets last error occurred.