2 * Copyright (c) 2013, TOYOTA MOTOR CORPORATION.
4 * This program is licensed under the terms and conditions of the
5 * Apache License, version 2.0. The full text of the Apache License is at
6 * http://www.apache.org/licenses/LICENSE-2.0
10 * @brief Gets the value of the joystick operation
14 #ifndef CJOYSTICKEV_H_
15 #define CJOYSTICKEV_H_
18 #include <linux/joystick.h>
24 #include "CJoyStick.h"
26 #define D_DEV_NAME_PARTS_EV "event"
28 class CJoyStickEV : public CJoyStick
32 virtual ~CJoyStickEV();
36 virtual int Read(int *number, int *value);
37 virtual int ReadData();
38 virtual bool getDeviceName(int fd, char* devNM, size_t sz);
39 int getJS_EVENT_BUTTON(int& num, int& val, const struct input_event& s);
40 virtual int getJS_EVENT_AXIS(int& num, int& val, const struct input_event& s);
41 int calc1pm32767(int val, const struct input_absinfo& ai);
42 int calc2p65535(int val, const struct input_absinfo& ai);
43 int calc3p32767(int val, const struct input_absinfo& ai);
44 int calc3p32767Reverse(int val, const struct input_absinfo& ai);
46 static void *loop(void *arg);
48 E_ABSX = 0, /* ABS_X */
52 E_ABSHAT0X, /* ABS_HAT0X */
53 E_ABSHAT0Y, /* ABS_HAT0Y */
56 struct input_absinfo m_absInf[E_ABSMAX];
57 std::string m_devName;
58 CJoyStickQueue<struct input_event > queue;
63 #endif /* CJOYSTICKEV_H_ */
65 * End of File.(CJoyStickEV.h)