Fang-Robotics-MCB
Fang Robotics Team Codebase
Loading...
Searching...
No Matches
tap::errors::ErrorController Class Reference

#include <error_controller.hpp>

Inheritance diagram for tap::errors::ErrorController:
Collaboration diagram for tap::errors::ErrorController:

Public Types

using error_index_t = modm::BoundedDeque< SystemError, ERROR_LIST_MAX_SIZE >::Index
 

Public Member Functions

 ErrorController (Drivers *drivers)
 
mockable ~ErrorController ()=default
 
mockable void addToErrorList (const SystemError &error)
 
void init ()
 
bool terminalSerialCallback (char *inputLine, modm::IOStream &outputStream, bool) override
 
void terminalSerialStreamCallback (modm::IOStream &) override
 

Static Public Attributes

static constexpr std::size_t ERROR_LIST_MAX_SIZE = 16
 

Friends

class ErrorControllerTester
 

Detailed Description

The ErrorController stores the errors that are currently active and allows the user to query errors via the terminal serial interface.

Use the RAISE_ERROR macro to add errors to the main ErrorController.

Member Typedef Documentation

◆ error_index_t

Constructor & Destructor Documentation

◆ ErrorController()

tap::errors::ErrorController::ErrorController ( Drivers drivers)
inline

◆ ~ErrorController()

mockable tap::errors::ErrorController::~ErrorController ( )
default

Member Function Documentation

◆ addToErrorList()

void tap::errors::ErrorController::addToErrorList ( const SystemError error)

Adds the passed in error to the ErrorController if no identical errors are already in the ErrorController.

Parameters
[in]errorThe SystemError to add to the ErrorController.

◆ init()

void tap::errors::ErrorController::init ( )

◆ terminalSerialCallback()

bool tap::errors::ErrorController::terminalSerialCallback ( char *  inputLine,
modm::IOStream &  outputStream,
bool  streamingEnabled 
)
overridevirtual
Parameters
[in]inputLineThe user input to be processed.
[out]outputStreamThe stream to write information to.
[in]streamingEnabledSet to true when the streaming is initially enabled. Subsequent interactions with the callback handler will be via terminalSerialStreamCallback until streaming has been disabled.
Returns
true if the inputLine was valid and was parsed correctly, false otherwise.

Implements tap::communication::serial::TerminalSerialCallbackInterface.

◆ terminalSerialStreamCallback()

void tap::errors::ErrorController::terminalSerialStreamCallback ( modm::IOStream &  outputStream)
inlineoverridevirtual

Called repeatedly by the TerminalSerial when in streaming mode.

Implements tap::communication::serial::TerminalSerialCallbackInterface.

Friends And Related Symbol Documentation

◆ ErrorControllerTester

friend class ErrorControllerTester
friend

Member Data Documentation

◆ ERROR_LIST_MAX_SIZE

constexpr std::size_t tap::errors::ErrorController::ERROR_LIST_MAX_SIZE = 16
staticconstexpr

The documentation for this class was generated from the following files: