vrpn
07.33
Virtual Reality Peripheral Network
vrpn_VPJoystick.h
Go to the documentation of this file.
1
2
#ifndef VRPN_VPJOYSTICK
3
#define VRPN_VPJOYSTICK 1
4
5
#include "
vrpn_Button.h
"
// for VRPN_BUTTON_BUF_SIZE, etc
6
#include "
vrpn_Configure.h
"
// for VRPN_API
7
8
class
VRPN_API
vrpn_Connection
;
9
10
11
#define vrpn_VPJOY_MESSAGE_LENGTH (4)
12
#define vrpn_VPJOY_NUM_BUTTONS (8)
13
14
class
VRPN_API
vrpn_VPJoystick
:
public
vrpn_Button_Filter
{
15
16
public
:
17
vrpn_VPJoystick
(
char
* name,
vrpn_Connection
*c,
18
const
char
*port=
"/dev/ttyS0"
,
long
baud=9600);
19
20
~
vrpn_VPJoystick
();
21
22
void
mainloop
();
23
24
private
:
25
int
serial_fd;
26
unsigned
char
buffer[
VRPN_BUTTON_BUF_SIZE
];
27
28
unsigned
char
message_buffer[
vrpn_VPJOY_MESSAGE_LENGTH
];
29
unsigned
int
bytes_read;
30
unsigned
int
button_masks[
vrpn_VPJOY_NUM_BUTTONS
];
31
32
unsigned
int
state;
33
};
34
35
#endif // #ifndef VRPN_VPJOYSTICK
vrpn_VPJOY_MESSAGE_LENGTH
#define vrpn_VPJOY_MESSAGE_LENGTH
Definition:
vrpn_VPJoystick.h:11
vrpn_VPJoystick
Definition:
vrpn_VPJoystick.h:14
vrpn_Button.h
vrpn_BaseClass::mainloop
virtual void mainloop()=0
Called once through each main loop iteration to handle updates. Remote object mainloop() should call ...
vrpn_Connection
Generic connection class not specific to the transport mechanism.
Definition:
vrpn_Connection.h:510
VRPN_BUTTON_BUF_SIZE
const int VRPN_BUTTON_BUF_SIZE
Definition:
vrpn_Button.h:13
vrpn_Configure.h
vrpn_VPJOY_NUM_BUTTONS
#define vrpn_VPJOY_NUM_BUTTONS
Definition:
vrpn_VPJoystick.h:12
VRPN_API
#define VRPN_API
Definition:
vrpn_Configure.h:646
vrpn_Button_Filter
All button servers should derive from this class, which provides the ability to turn any of the butto...
Definition:
vrpn_Button.h:65
vrpn_VPJoystick.h
Generated by
1.8.17