73 typedef std::function<void(
const char *joystick_n,
double mag,
double angle,
void *context)>
joystickFunc;
78 typedef std::function<void(
const char *axis_n,
double value,
void *context)>
axisFunc;
96 virtual bool ISNewSwitch(
const char *dev,
const char *name,
ISState *states,
char *names[],
int n);
97 virtual bool ISNewText(
const char *dev,
const char *name,
char *texts[],
char *names[],
int n);
108 const char *initialValue);
137 static void joystickEvent(
const char *joystick_n,
double mag,
double angle,
void *context);
138 static void axisEvent(
const char *axis_n,
int value,
void *context);
139 static void buttonEvent(
const char *button_n,
int value,
void *context);
156 IText JoystickDeviceT[1] {};
159 IText *JoystickSettingT =
nullptr;
The Controller class provides functionality to access a controller (e.g. joystick) input and send it ...
void setButtonCallback(buttonFunc buttonCallback)
setButtonCallback Sets the callback function when a new button input is detected.
static void joystickEvent(const char *joystick_n, double mag, double angle, void *context)
virtual bool ISSnoopDevice(XMLEle *root)
const char * getControllerSetting(const char *name)
virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n)
void clearMap()
clearMap clears all properties added previously by mapController()
void mapController(const char *propertyName, const char *propertyLabel, ControllerType type, const char *initialValue)
mapController adds a new property to the joystick's settings.
virtual bool initProperties()
void setAxisCallback(axisFunc axisCallback)
setAxisCallback Sets the callback function when a new axis input is detected.
INDI::DefaultDevice * device
virtual bool saveConfigItems(FILE *fp)
virtual void ISGetProperties(const char *dev)
std::function< void(const char *button_n, ISState state, void *context)> buttonFunc
buttonFunc Button callback function signature.
axisFunc axisCallbackFunc
virtual bool updateProperties()
void setJoystickCallback(joystickFunc joystickCallback)
setJoystickCallback Sets the callback function when a new joystick input is detected.
joystickFunc joystickCallbackFunc
virtual bool ISNewText(const char *dev, const char *name, char *texts[], char *names[], int n)
static void buttonEvent(const char *button_n, int value, void *context)
std::function< void(const char *axis_n, double value, void *context)> axisFunc
axisFunc Axis callback function signature.
Controller(INDI::DefaultDevice *cdevice)
Controller Default ctor.
ControllerType getControllerType(const char *name)
std::function< void(const char *joystick_n, double mag, double angle, void *context)> joystickFunc
joystickFunc Joystick callback function signature.
buttonFunc buttonCallbackFunc
static void axisEvent(const char *axis_n, int value, void *context)
Class to provide extended functionality for devices in addition to the functionality provided by INDI...
Namespace to encapsulate INDI client, drivers, and mediator classes.
Switch vector property descriptor.
Text vector property descriptor.