Open FFBoard
Open source force feedback firmware
FFBoardMainCommandThread Class Reference

#include <FFBoardMainCommandThread.h>

Inheritance diagram for FFBoardMainCommandThread:
cpp_freertos::Thread

Public Member Functions

 FFBoardMainCommandThread (FFBoardMain *mainclass)
 
virtual ~FFBoardMainCommandThread ()
 
const ClassType getClassType ()
 
bool addBuf (char *Buf, uint32_t *Len, bool clearReply)
 
void Run ()
 
- Public Member Functions inherited from cpp_freertos::Thread
 Thread (const std::string Name, uint16_t StackDepth, UBaseType_t Priority)
 
 Thread (const char *Name, uint16_t StackDepth, UBaseType_t Priority)
 
 Thread (uint16_t StackDepth, UBaseType_t Priority)
 
bool Start ()
 
virtual ~Thread ()
 
TaskHandle_t GetHandle ()
 
void Suspend ()
 
void Resume ()
 
void ResumeFromISR ()
 
void Notify ()
 
void NotifyFromISR ()
 
uint32_t WaitForNotification (TickType_t Timeout=portMAX_DELAY)
 
UBaseType_t GetPriority ()
 
UBaseType_t GetPriorityFromISR ()
 
void SetPriority (UBaseType_t NewPriority)
 
std::string GetName ()
 
char * GetName ()
 

Static Public Member Functions

static void wakeUp ()
 
- Static Public Member Functions inherited from cpp_freertos::Thread
static void Yield ()
 
static void StartScheduler ()
 
static void EndScheduler ()
 

Public Attributes

std::string cmd_reply
 
std::vector< CommandResultresults
 
std::vector< ParsedCommandcommands
 
bool clearReply = true
 

Static Public Attributes

static Error cmdNotFoundError = Error(ErrorCode::cmdNotFound,ErrorType::temporary,"Invalid command")
 
static Error cmdExecError = Error(ErrorCode::cmdExecutionError,ErrorType::temporary,"Error while executing command")
 

Protected Member Functions

virtual void executeCommands (std::vector< ParsedCommand > &commands, CommandInterface *commandInterface)
 
- Protected Member Functions inherited from cpp_freertos::Thread
virtual void Cleanup ()
 
void Delay (const TickType_t Delay)
 
void DelayUntil (const TickType_t Period)
 
void ResetDelayUntil ()
 
bool Wait (ConditionVariable &Cv, Mutex &CvLock, TickType_t Timeout=portMAX_DELAY)
 

Detailed Description

Definition at line 31 of file FFBoardMainCommandThread.h.

Constructor & Destructor Documentation

◆ FFBoardMainCommandThread()

FFBoardMainCommandThread::FFBoardMainCommandThread ( FFBoardMain mainclass)

Definition at line 33 of file FFBoardMainCommandThread.cpp.

◆ ~FFBoardMainCommandThread()

FFBoardMainCommandThread::~FFBoardMainCommandThread ( )
virtual

Definition at line 40 of file FFBoardMainCommandThread.cpp.

Member Function Documentation

◆ addBuf()

bool FFBoardMainCommandThread::addBuf ( char *  Buf,
uint32_t *  Len,
bool  clearReply 
)

◆ executeCommands()

void FFBoardMainCommandThread::executeCommands ( std::vector< ParsedCommand > &  commands,
CommandInterface commandInterface 
)
protectedvirtual

Executes parsed commands and calls other command handlers. Not global so it can be overridden by main classes to change behaviour or suppress outputs.

Definition at line 91 of file FFBoardMainCommandThread.cpp.

◆ getClassType()

const ClassType FFBoardMainCommandThread::getClassType ( )
inline

Definition at line 39 of file FFBoardMainCommandThread.h.

◆ Run()

void FFBoardMainCommandThread::Run ( )
virtual

Implementation of your actual thread code. You must override this function.

Note
If INCLUDE_vTaskDelete is defined, then you may return from your Run method. This will cause the task to be deleted from FreeRTOS, however you are still responsible to delete the task object. If this is not defined, then retuning from your Run() method will result in an assert.

Implements cpp_freertos::Thread.

Definition at line 46 of file FFBoardMainCommandThread.cpp.

◆ wakeUp()

void FFBoardMainCommandThread::wakeUp ( )
static

Signals the command thread that new commands are ready to be executed

Definition at line 68 of file FFBoardMainCommandThread.cpp.

Member Data Documentation

◆ clearReply

bool FFBoardMainCommandThread::clearReply = true

Definition at line 52 of file FFBoardMainCommandThread.h.

◆ cmd_reply

std::string FFBoardMainCommandThread::cmd_reply

Definition at line 49 of file FFBoardMainCommandThread.h.

◆ cmdExecError

Error FFBoardMainCommandThread::cmdExecError = Error(ErrorCode::cmdExecutionError,ErrorType::temporary,"Error while executing command")
static

Definition at line 55 of file FFBoardMainCommandThread.h.

◆ cmdNotFoundError

Error FFBoardMainCommandThread::cmdNotFoundError = Error(ErrorCode::cmdNotFound,ErrorType::temporary,"Invalid command")
static

Definition at line 54 of file FFBoardMainCommandThread.h.

◆ commands

std::vector<ParsedCommand> FFBoardMainCommandThread::commands

Definition at line 51 of file FFBoardMainCommandThread.h.

◆ results

std::vector<CommandResult> FFBoardMainCommandThread::results

Definition at line 50 of file FFBoardMainCommandThread.h.


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