Open FFBoard
Open source force feedback firmware
FFBoardMainCommandThread.h
Go to the documentation of this file.
1/*
2 * FFBoardMainCommandThread.h
3 *
4 * Created on: Feb 13, 2021
5 * Author: Yannick
6 */
7
8#ifndef USEREXTENSIONS_SRC_FFBOARDMAINCOMMANDTHREAD_H_
9#define USEREXTENSIONS_SRC_FFBOARDMAINCOMMANDTHREAD_H_
10
11
12#include <CmdParser.h>
13#include "cppmain.h"
14#include "main.h"
15#include <string>
16#include "cdc_device.h"
17#include "ChoosableClass.h"
18#include "CommandHandler.h"
19#include <vector>
20#include "ErrorHandler.h"
21#include "thread.hpp"
22#include "FFBoardMain.h"
23#include "semaphore.hpp"
24
25#include "CommandInterface.h"
26
27class FFBoardMain;
28//class CommandInterface;
29
30
32{
33public:
36
37// const ClassIdentifier getInfo();
38// static ClassIdentifier info;
40
41 bool addBuf(char* Buf, uint32_t *Len,bool clearReply);
42
43 void Run();
44
45 static void wakeUp();
46
47 //FFBoardMain* main;
48
49 std::string cmd_reply;
50 std::vector<CommandResult> results; // Stores the results until the next batch to pass back to the interface
51 std::vector<ParsedCommand> commands;
52 bool clearReply = true;
53
56
57protected:
58 virtual void executeCommands(std::vector<ParsedCommand>& commands,CommandInterface* commandInterface);
59
60
61 //static cpp_freertos::BinarySemaphore threadSem; // Blocks this thread. more efficient than suspending/waking
62};
63
64#endif /* USEREXTENSIONS_SRC_FFBOARDMAINCOMMANDTHREAD_H_ */
ClassType
Definition: ClassIDs.h:12
virtual void executeCommands(std::vector< ParsedCommand > &commands, CommandInterface *commandInterface)
std::vector< ParsedCommand > commands
std::vector< CommandResult > results
FFBoardMainCommandThread(FFBoardMain *mainclass)
bool addBuf(char *Buf, uint32_t *Len, bool clearReply)
FFBoardMain * mainclass