Go to the documentation of this file. 1 #ifndef __USERINTERFACE_H_
2 #define __USERINTERFACE_H_
7 #include <ros/subscriber.h>
28 void flush()
override;
29 int print(
const char* format, ...)
override;
30 int print(
const char* format, va_list args)
override;
31 int printLine(
const char* format, ...)
override;
32 int printLine(
const char* format, va_list args)
override;
35 void setLed(
LED led,
bool state)
override;
39 void* context)
override;
51 #endif // __USERINTERFACE_H_
void setHexDisplay(uint8_t value) override
Sets the hex display to a given 8 bit value (not available on the HiveSight)
Definition: UserInterface.cpp:92
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 new...
Definition: UserInterface.cpp:70
Definition: UserInterface.h:15
void flush() override
Adds a newline and flushes the input to the serial port.
Definition: UserInterface.cpp:37
LED
LED present on the board.
Definition: IUserInterface.h:22
std::string uiStateToString()
Definition: UserInterface.cpp:114
std::array< ros::Subscriber, g_nbrLED > m_buttonSubscribers
Definition: UserInterface.h:43
void setLed(LED led, bool state) override
Sets an LED on or off.
Definition: UserInterface.cpp:88
Button
Buttons present on the board.
Definition: IUserInterface.h:16
uint8_t m_hexDisplay
Definition: UserInterface.h:19
RgbColor
Possible colors obtainable with an RGB LED.
Definition: IUserInterface.h:11
~UserInterface() override=default
const IBSP & m_bsp
Definition: UserInterface.h:45
std::string m_accumulatedString
Definition: UserInterface.h:46
RgbColor m_rgbLed
Definition: UserInterface.h:17
void setButtonCallback(Button button, buttonCallbackFunction_t callback, void *context) override
Sets the callback associated with a given button press.
Definition: UserInterface.cpp:94
UIState m_uiState
Definition: UserInterface.h:48
int print(const char *format,...) override
Provides an interface to print to the console or serial port. The arguments and return values match t...
Definition: UserInterface.cpp:43
UserInterface(const IBSP &bsp)
Definition: UserInterface.cpp:33
void setRGBLed(RgbColor color) override
Sets the RGB LED to a given color.
Definition: UserInterface.cpp:86
Mutex m_mutex
Definition: UserInterface.h:47
Manages the user interface The user interface can consist of buttons, LED, serial print ports,...
Definition: IUserInterface.h:36
std::array< bool, g_nbrLED > m_ledStates
Definition: UserInterface.h:18
Mutex & getPrintMutex() override
get the mutex for printing. Note that the mutex is not used in any functions, the user needs to lock ...
Definition: UserInterface.cpp:35
void(* buttonCallbackFunction_t)(void *instance)
Prototype for a callback from a button press.
Definition: IUserInterface.h:28
Definition: UserInterface.h:22
UIState()
Definition: UserInterface.cpp:31