vrpn
07.35
Virtual Reality Peripheral Network
Toggle main menu visibility
Loading...
Searching...
No Matches
vrpn_UNC_Joystick.h
Go to the documentation of this file.
1
#ifndef VRPN_JOYSTICK
2
#define VRPN_JOYSTICK
3
#include "
vrpn_Analog.h
"
// for vrpn_CHANNEL_MAX, etc
4
#include "
vrpn_Button.h
"
// for vrpn_Button_Filter
5
#include "
vrpn_Configure.h
"
// for VRPN_API
6
7
class
VRPN_API
vrpn_Connection
;
8
9
// This class runs the UNC custom serial joystick. It includes two
10
// buttons, a slider, and two 3-axis joysticks. It is based on a
11
// single-board computer. This driver is based on the px_sjoy.c
12
// code.
13
14
class
VRPN_API
vrpn_Joystick
:
public
vrpn_Serial_Analog
,
public
vrpn_Button_Filter
{
15
public
:
16
vrpn_Joystick
(
char
* name,
vrpn_Connection
* c,
char
*
portname
,
int
17
baud,
double
);
18
19
void
mainloop
(
void
);
20
21
protected
:
22
int
get_report
();
23
void
report
(
struct
timeval current_time);
24
void
reset
();
25
void
parse
(
int
,
int
reset_rest_pos = 0);
26
private
:
27
unsigned
char
serialbuf[32];
28
double
restval[
vrpn_CHANNEL_MAX
];
// Initial value of each channel
29
unsigned
long
MAX_TIME_INTERVAL;
30
};
31
32
33
#endif
vrpn_Analog::report
virtual void report(vrpn_uint32 class_of_service=vrpn_CONNECTION_LOW_LATENCY, const struct timeval time=vrpn_ANALOG_NOW)
Send a report whether something has changed or not (for servers) Optionally, tell what time to stamp ...
Definition
vrpn_Analog.C:94
vrpn_BaseClass::mainloop
virtual void mainloop()=0
Called once through each main loop iteration to handle updates. Remote object mainloop() should call ...
vrpn_Button_Filter::vrpn_Button_Filter
vrpn_Button_Filter(const char *, vrpn_Connection *c=NULL)
Definition
vrpn_Button.C:129
vrpn_Connection
Generic connection class not specific to the transport mechanism.
Definition
vrpn_Connection.h:561
vrpn_Joystick::vrpn_Joystick
vrpn_Joystick(char *name, vrpn_Connection *c, char *portname, int baud, double)
Definition
vrpn_UNC_Joystick.C:17
vrpn_Joystick::parse
void parse(int, int reset_rest_pos=0)
Definition
vrpn_UNC_Joystick.C:204
vrpn_Joystick::reset
void reset()
Definition
vrpn_UNC_Joystick.C:100
vrpn_Joystick::get_report
int get_report()
Definition
vrpn_UNC_Joystick.C:146
vrpn_Serial_Analog::portname
char portname[1024]
Definition
vrpn_Analog.h:73
vrpn_Serial_Analog::vrpn_Serial_Analog
vrpn_Serial_Analog(const char *name, vrpn_Connection *connection, const char *port, int baud=9600, int bits=8, vrpn_SER_PARITY parity=vrpn_SER_PARITY_NONE, bool rts_flow=false)
Definition
vrpn_Analog.C:124
vrpn_Analog.h
vrpn_CHANNEL_MAX
#define vrpn_CHANNEL_MAX
Definition
vrpn_Analog.h:16
vrpn_Button.h
vrpn_Configure.h
VRPN_API
#define VRPN_API
Definition
vrpn_Configure.h:648
vrpn_Connection
class VRPN_API vrpn_Connection
Definition
vrpn_UNC_Joystick.h:7
vrpn_UNC_Joystick.h
Generated by
1.17.0