ControllerHandler.h 864 B

123456789101112131415161718192021222324252627282930313233
  1. #pragma once
  2. //
  3. // Created by janco on 5/23/16.
  4. //
  5. #define BasestationBaudrate 115200
  6. #include <thread>
  7. #include "include/serial.h"
  8. #include "Controller.h"
  9. class ControllerHandler{
  10. public:
  11. ControllerHandler();
  12. Controller* getLeftController(void);
  13. void rumble(int idController, int duration, int power);
  14. private:
  15. void SearchBasestation(void);
  16. void BasestationReader(void);
  17. bool basestationFound;
  18. serial::Serial *baseStation;
  19. std::thread readthread;
  20. std::vector<Controller*> controllers {0};
  21. //Command functions
  22. void commandDebug(std::vector<std::string> data);
  23. void commandControllerData(std::vector<std::string> data);
  24. void commandControllerEvent(std::vector<std::string> data);
  25. void commandControllerList(std::vector<std::string> data);
  26. //void(*commandList [1])(std::vector<std::string> data);
  27. };