Commander-API
V2.1.0
Simple Command Parser
|
Default response class. More...
#include <Commander-IO.hpp>
Public Member Functions | |
int | available () |
Available bytes in the channel. More... | |
int | read () |
Read one byte form the channel. More... | |
int | peek () |
Peek the firtst byte from the channel. More... | |
void | flush () |
Flush the channel. More... | |
size_t | write (uint8_t b) |
Write one byte to the channel. More... | |
Default response class.
This base class is responsible to create a communication channel between the function associated with a command and the sender entity. This entity can be anything like Serial, Client... Because every function in this class is virtual, it means that they can be overridden with subclasses. It is useful, because if we make a subclass for every entity that can communicate with Commander, we can automatically pair the right function for that entity. The base class doesn't do much. To make it any use, we have to create a subclass for it like below.
Definition at line 72 of file Commander-IO.hpp.
|
inline |
Available bytes in the channel.
Definition at line 79 of file Commander-IO.hpp.
|
inline |
Flush the channel.
Definition at line 92 of file Commander-IO.hpp.
|
inline |
Peek the firtst byte from the channel.
Definition at line 89 of file Commander-IO.hpp.
|
inline |
Read one byte form the channel.
Definition at line 84 of file Commander-IO.hpp.
|
inline |
Write one byte to the channel.
b | The value that has to be written to the channel. |
Definition at line 98 of file Commander-IO.hpp.