#include <UserInterface.h>
|
| UserInterface (const IBSP &bsp) |
|
| ~UserInterface () override=default |
|
Mutex & | getPrintMutex () override |
| get the mutex for printing. Note that the mutex is not used in any functions, the user needs to lock and unlock this mutex More...
|
|
void | flush () override |
| Adds a newline and flushes the input to the serial port. More...
|
|
int | print (const char *format,...) override |
| Provides an interface to print to the console or serial port. The arguments and return values match the standard printf library. A flush needs to be called after this function. More...
|
|
int | print (const char *format, va_list args) override |
| Provides an interface to print to the console or serial port using an initialized va_list. The return value matches the standard printf library. A flush needs to be called after this function. More...
|
|
int | printLine (const char *format,...) override |
| Provides an interface to print a line to the console or serial port. Flushes the input and adds a newline. The arguments and return values match the standard printf library. More...
|
|
int | printLine (const char *format, va_list args) override |
| Provides an interface to print to the console or serial port using an initialized va_list. Flushes the input and adds a newline. The return value matches the standard printf library. More...
|
|
void | setRGBLed (RgbColor color) override |
| Sets the RGB LED to a given color. More...
|
|
void | setLed (LED led, bool state) override |
| Sets an LED on or off. More...
|
|
void | setHexDisplay (uint8_t value) override |
| Sets the hex display to a given 8 bit value (not available on the HiveSight) More...
|
|
void | setButtonCallback (Button button, buttonCallbackFunction_t callback, void *context) override |
| Sets the callback associated with a given button press. More...
|
|
virtual | ~IUserInterface ()=default |
|
◆ UserInterface()
UserInterface::UserInterface |
( |
const IBSP & |
bsp | ) |
|
◆ ~UserInterface()
UserInterface::~UserInterface |
( |
| ) |
|
|
overridedefault |
◆ flush()
void UserInterface::flush |
( |
| ) |
|
|
overridevirtual |
Adds a newline and flushes the input to the serial port.
Implements IUserInterface.
◆ getPrintMutex()
Mutex & UserInterface::getPrintMutex |
( |
| ) |
|
|
overridevirtual |
get the mutex for printing. Note that the mutex is not used in any functions, the user needs to lock and unlock this mutex
Implements IUserInterface.
◆ print() [1/2]
int UserInterface::print |
( |
const char * |
format, |
|
|
va_list |
args |
|
) |
| |
|
overridevirtual |
Provides an interface to print to the console or serial port using an initialized va_list. The return value matches the standard printf library. A flush needs to be called after this function.
- Parameters
-
[in] | format | Text to be written, can contain format specifiers that will be replaced by values specified in the additional arguments, matches the standard printf function |
[in] | args | Previously initialized va_list |
- Returns
- Matches the standard printf return. The total number of characters is returned or a negative number on error
Implements IUserInterface.
◆ print() [2/2]
int UserInterface::print |
( |
const char * |
format, |
|
|
|
... |
|
) |
| |
|
overridevirtual |
Provides an interface to print to the console or serial port. The arguments and return values match the standard printf library. A flush needs to be called after this function.
- Parameters
-
[in] | format | Text to be written, can contain format specifiers that will be replaced by values specified in the additional arguments, matches the standard printf function |
[in] | ... | Additionnal arguments for the format parameter |
- Returns
- Matches the standard printf return. The total number of characters is returned or a negative number on error
Implements IUserInterface.
◆ printLine() [1/2]
int UserInterface::printLine |
( |
const char * |
format, |
|
|
va_list |
args |
|
) |
| |
|
overridevirtual |
Provides an interface to print to the console or serial port using an initialized va_list. Flushes the input and adds a newline. The return value matches the standard printf library.
- Parameters
-
[in] | format | Text to be written, can contain format specifiers that will be replaced by values specified in the additional arguments, matches the standard printf function |
[in] | args | Previously initialized va_list |
- Returns
- Matches the standard printf return. The total number of characters is returned or a negative number on error
Implements IUserInterface.
◆ printLine() [2/2]
int UserInterface::printLine |
( |
const char * |
format, |
|
|
|
... |
|
) |
| |
|
overridevirtual |
Provides an interface to print a line to the console or serial port. Flushes the input and adds a newline. The arguments and return values match the standard printf library.
- Parameters
-
[in] | format | Text to be written, can contain format specifiers that will be replaced by values specified in the additional arguments, matches the standard printf function |
[in] | ... | Additionnal arguments for the format parameter |
- Returns
- Matches the standard printf return. The total number of characters is returned or a negative number on error
Implements IUserInterface.
◆ setButtonCallback()
Sets the callback associated with a given button press.
- Parameters
-
button | Button to register the callback on |
callback | Callback to call |
context | Context to pass to the callback |
Implements IUserInterface.
◆ setHexDisplay()
void UserInterface::setHexDisplay |
( |
uint8_t |
value | ) |
|
|
overridevirtual |
Sets the hex display to a given 8 bit value (not available on the HiveSight)
- Parameters
-
Implements IUserInterface.
◆ setLed()
void UserInterface::setLed |
( |
LED |
led, |
|
|
bool |
state |
|
) |
| |
|
overridevirtual |
Sets an LED on or off.
- Parameters
-
led | wich led to toggle |
state | which state to put the led (on or off) |
Implements IUserInterface.
◆ setRGBLed()
void UserInterface::setRGBLed |
( |
RgbColor |
color | ) |
|
|
overridevirtual |
Sets the RGB LED to a given color.
- Parameters
-
Implements IUserInterface.
◆ uiStateToString()
std::string UserInterface::uiStateToString |
( |
| ) |
|
|
private |
◆ m_accumulatedString
std::string UserInterface::m_accumulatedString |
|
private |
◆ m_bsp
const IBSP& UserInterface::m_bsp |
|
private |
◆ m_buttonSubscribers
std::array<ros::Subscriber, g_nbrLED> UserInterface::m_buttonSubscribers |
|
private |
◆ m_mutex
Mutex UserInterface::m_mutex |
|
private |
◆ m_uiState
The documentation for this class was generated from the following files: