vrpn
07.35
Virtual Reality Peripheral Network
Toggle main menu visibility
Loading...
Searching...
No Matches
vrpn_Spaceball.h
Go to the documentation of this file.
1
#ifndef VRPN_SPACEBALL_H
2
#define VRPN_SPACEBALL_H
3
4
#include "
vrpn_Analog.h
"
// for vrpn_Serial_Analog
5
#include "
vrpn_Button.h
"
// for vrpn_Button_Filter
6
#include "
vrpn_Configure.h
"
// for VRPN_API
7
#include "
vrpn_Connection.h
"
// for vrpn_CONNECTION_LOW_LATENCY, etc
8
#include "
vrpn_Shared.h
"
// for timeval
9
#include "
vrpn_Types.h
"
// for vrpn_uint32
10
11
class
VRPN_API
vrpn_Spaceball
:
public
vrpn_Serial_Analog
12
,
public
vrpn_Button_Filter
13
{
14
public
:
15
vrpn_Spaceball
(
const
char
* name,
vrpn_Connection
* c,
16
const
char
* port,
int
baud);
17
18
~vrpn_Spaceball
() {};
19
21
virtual
void
mainloop
();
22
23
virtual
int
reset(
void
);
24
25
protected
:
26
int
_numbuttons
;
27
int
_numchannels
;
28
unsigned
char
buf
[512];
29
int
bufpos
;
30
int
packtype
;
31
int
packlen
;
32
int
escapedchar
;
33
int
erroroccured
;
34
int
resetoccured
;
35
int
spaceball4000
;
36
int
leftymode4000
;
37
int
null_radius
;
38
struct
timeval
timestamp
;
39
40
virtual
void
clear_values
(
void
);
41
44
virtual
int
get_report
(
void
);
45
47
virtual
void
report_changes
48
(vrpn_uint32 class_of_service
49
=
vrpn_CONNECTION_LOW_LATENCY
);
50
52
virtual
void
report
53
(vrpn_uint32 class_of_service
54
=
vrpn_CONNECTION_LOW_LATENCY
);
55
56
// NOTE: class_of_service is only applied to vrpn_Analog
57
// values, not vrpn_Button, which are always vrpn_RELIABLE
58
};
59
60
#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_Analog::report_changes
virtual void report_changes(vrpn_uint32 class_of_service=vrpn_CONNECTION_LOW_LATENCY, const struct timeval time=vrpn_ANALOG_NOW)
Send a report only if something has changed (for servers) Optionally, tell what time to stamp the val...
Definition
vrpn_Analog.C:71
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_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_Spaceball::packtype
int packtype
What kind of packet we are decoding.
Definition
vrpn_Spaceball.h:30
vrpn_Spaceball::vrpn_Spaceball
vrpn_Spaceball(const char *name, vrpn_Connection *c, const char *port, int baud)
Definition
vrpn_Spaceball.C:94
vrpn_Spaceball::~vrpn_Spaceball
~vrpn_Spaceball()
Definition
vrpn_Spaceball.h:18
vrpn_Spaceball::packlen
int packlen
Expected packet length.
Definition
vrpn_Spaceball.h:31
vrpn_Spaceball::spaceball4000
int spaceball4000
We found a Spaceball 4000.
Definition
vrpn_Spaceball.h:35
vrpn_Spaceball::get_report
virtual int get_report(void)
Try to read reports from the device. Returns 1 if a complete report received, 0 otherwise....
Definition
vrpn_Spaceball.C:185
vrpn_Spaceball::_numchannels
int _numchannels
How many analog channels to open.
Definition
vrpn_Spaceball.h:27
vrpn_Spaceball::buf
unsigned char buf[512]
Buffer of characters in report,.
Definition
vrpn_Spaceball.h:28
vrpn_Spaceball::leftymode4000
int leftymode4000
Spaceball 4000 is in lefty mode.
Definition
vrpn_Spaceball.h:36
vrpn_Spaceball::resetoccured
int resetoccured
A reset event has occurred.
Definition
vrpn_Spaceball.h:34
vrpn_Spaceball::bufpos
int bufpos
Current char pos in buffer.
Definition
vrpn_Spaceball.h:29
vrpn_Spaceball::escapedchar
int escapedchar
We're processing an escaped char.
Definition
vrpn_Spaceball.h:32
vrpn_Spaceball::_numbuttons
int _numbuttons
How many buttons to open.
Definition
vrpn_Spaceball.h:26
vrpn_Spaceball::clear_values
virtual void clear_values(void)
Set all buttons, analogs and encoders back to 0.
Definition
vrpn_Spaceball.C:122
vrpn_Spaceball::null_radius
int null_radius
range where no motion should be reported
Definition
vrpn_Spaceball.h:37
vrpn_Spaceball::timestamp
struct timeval timestamp
Time of the last report from the device.
Definition
vrpn_Spaceball.h:38
vrpn_Spaceball::erroroccured
int erroroccured
A device error has occurred.
Definition
vrpn_Spaceball.h:33
vrpn_Analog.h
vrpn_Button.h
vrpn_Configure.h
VRPN_API
#define VRPN_API
Definition
vrpn_Configure.h:648
vrpn_Connection.h
vrpn_CONNECTION_LOW_LATENCY
const vrpn_uint32 vrpn_CONNECTION_LOW_LATENCY
Definition
vrpn_Connection.h:120
vrpn_Shared.h
vrpn_Types.h
vrpn_Spaceball.h
Generated by
1.17.0