Open FFBoard
Open source force feedback firmware
HID_CommandInterface Class Reference

#include <HidCommandInterface.h>

Inheritance diagram for HID_CommandInterface:
CommandInterface cpp_freertos::Thread

Public Member Functions

 HID_CommandInterface ()
 
virtual ~HID_CommandInterface ()
 
const std::string getHelpstring ()
 
bool getNewCommands (std::vector< ParsedCommand > &commands)
 
void sendReplies (const std::vector< CommandResult > &results, CommandInterface *originalInterface)
 
void hidCmdCallback (HID_CMD_Data_t *data)
 
bool sendHidCmd (HID_CMD_Data_t *data)
 
void queueReplyValues (const CommandReply &reply, const ParsedCommand &command)
 
void transferComplete (uint8_t itf, uint8_t const *report, uint8_t len)
 
bool readyToSend ()
 
void Run ()
 
bool waitingToSend ()
 
- Public Member Functions inherited from CommandInterface
 CommandInterface ()
 
virtual ~CommandInterface ()
 
virtual bool hasNewCommands ()
 
virtual void sendReplyAsync (std::vector< CommandReply > &reply, CommandHandler *handler, uint32_t cmdId, CMDtype type)
 
virtual void batchDone ()
 
- 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 Attributes

static HID_CommandInterfaceglobalInterface = nullptr
 
- Static Public Attributes inherited from CommandInterface
static std::vector< CommandInterface * > cmdInterfaces
 

Private Attributes

std::vector< ParsedCommandcommands
 
std::vector< HID_CMD_Data_t > outBuffer
 
bool enableBroadcastFromOtherInterfaces = true
 
const uint32_t maxQueuedReplies = 50
 
const uint32_t maxQueuedRepliesBroadcast = 10
 

Additional Inherited Members

- Static Public Member Functions inherited from CommandInterface
static CommandResult makeCommandReply (const std::vector< CommandReply > &reply, CommandHandler *handler, uint32_t cmdId, CMDtype type=CMDtype::get, CommandInterface *originalInterface=nullptr)
 
static void broadcastCommandReplyAsync (const std::vector< CommandReply > &reply, CommandHandler *handler, uint32_t cmdId, CMDtype type=CMDtype::get)
 
- Static Public Member Functions inherited from cpp_freertos::Thread
static void Yield ()
 
static void StartScheduler ()
 
static void EndScheduler ()
 
- 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)
 
- Protected Attributes inherited from CommandInterface
bool parserReady = false
 

Detailed Description

Definition at line 35 of file HidCommandInterface.h.

Constructor & Destructor Documentation

◆ HID_CommandInterface()

HID_CommandInterface::HID_CommandInterface ( )

Definition at line 22 of file HidCommandInterface.cpp.

◆ ~HID_CommandInterface()

HID_CommandInterface::~HID_CommandInterface ( )
virtual

Definition at line 27 of file HidCommandInterface.cpp.

Member Function Documentation

◆ getHelpstring()

const std::string HID_CommandInterface::getHelpstring ( )
inlinevirtual

Reimplemented from CommandInterface.

Definition at line 42 of file HidCommandInterface.h.

◆ getNewCommands()

bool HID_CommandInterface::getNewCommands ( std::vector< ParsedCommand > &  commands)
virtual

Implements CommandInterface.

Definition at line 31 of file HidCommandInterface.cpp.

◆ hidCmdCallback()

void HID_CommandInterface::hidCmdCallback ( HID_CMD_Data_t *  data)

Definition at line 158 of file HidCommandInterface.cpp.

◆ queueReplyValues()

void HID_CommandInterface::queueReplyValues ( const CommandReply reply,
const ParsedCommand command 
)

Definition at line 115 of file HidCommandInterface.cpp.

◆ readyToSend()

bool HID_CommandInterface::readyToSend ( )
virtual

Returns true if it can send replies. False if the command thread should wait until previous replies are processed

Reimplemented from CommandInterface.

Definition at line 62 of file HidCommandInterface.cpp.

◆ Run()

void HID_CommandInterface::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 39 of file HidCommandInterface.cpp.

◆ sendHidCmd()

bool HID_CommandInterface::sendHidCmd ( HID_CMD_Data_t *  data)

Definition at line 216 of file HidCommandInterface.cpp.

◆ sendReplies()

void HID_CommandInterface::sendReplies ( const std::vector< CommandResult > &  results,
CommandInterface originalInterface 
)
virtual

Implements CommandInterface.

Definition at line 66 of file HidCommandInterface.cpp.

◆ transferComplete()

void HID_CommandInterface::transferComplete ( uint8_t  itf,
uint8_t const *  report,
uint8_t  len 
)

Definition at line 152 of file HidCommandInterface.cpp.

◆ waitingToSend()

bool HID_CommandInterface::waitingToSend ( )

true if output buffer contains data

Definition at line 58 of file HidCommandInterface.cpp.

Member Data Documentation

◆ commands

std::vector<ParsedCommand> HID_CommandInterface::commands
private

Definition at line 55 of file HidCommandInterface.h.

◆ enableBroadcastFromOtherInterfaces

bool HID_CommandInterface::enableBroadcastFromOtherInterfaces = true
private

Definition at line 57 of file HidCommandInterface.h.

◆ globalInterface

HID_CommandInterface * HID_CommandInterface::globalInterface = nullptr
static

Definition at line 40 of file HidCommandInterface.h.

◆ maxQueuedReplies

const uint32_t HID_CommandInterface::maxQueuedReplies = 50
private

Definition at line 59 of file HidCommandInterface.h.

◆ maxQueuedRepliesBroadcast

const uint32_t HID_CommandInterface::maxQueuedRepliesBroadcast = 10
private

Definition at line 60 of file HidCommandInterface.h.

◆ outBuffer

std::vector<HID_CMD_Data_t> HID_CommandInterface::outBuffer
private

Definition at line 56 of file HidCommandInterface.h.


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