Files
sdrpi-fpv-control/ground/joystick-reader.h

28 lines
538 B
C++

#ifndef SDRPI_FPV_CONTROL_GROUND_JOYSTICK_READER_H
#define SDRPI_FPV_CONTROL_GROUND_JOYSTICK_READER_H
#include <cstdint>
#include <vector>
#include <string>
#ifdef _WIN32
#include <SDL.h>
#else
#include <SDL2/SDL.h>
#endif
class JoystickReader {
public:
JoystickReader();
~JoystickReader();
bool initialize();
bool readData(std::vector<uint16_t>& data);
std::string getJoystickName() const;
private:
SDL_Joystick* joystick;
std::string joystickName;
};
#endif //SDRPI_FPV_CONTROL_GROUND_JOYSTICK_READER_H