vrpn
07.33
Virtual Reality Peripheral Network
vrpn_Magellan.h
Go to the documentation of this file.
1
#ifndef VRPN_MAGELLAN_H
2
#define VRPN_MAGELLAN_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_Magellan
:
public
vrpn_Serial_Analog
12
,
public
vrpn_Button_Filter
13
{
14
public
:
15
vrpn_Magellan
(
const
char
* name,
vrpn_Connection
* c,
16
const
char
* port,
int
baud,
bool
altreset =
false
);
17
18
~vrpn_Magellan
() {};
19
21
virtual
void
mainloop
();
22
23
virtual
int
reset(
void
);
//< Set device back to starting config
24
25
protected
:
26
bool
_altreset
;
//< Send alternative reset string?
27
int
_status
;
//< Used by mainloop() and get_report()
28
int
_numbuttons
;
//< How many buttons to open
29
int
_numchannels
;
//< How many analog channels to open
30
31
unsigned
_expected_chars
;
//< How many characters to expect in the report
32
unsigned
char
_buffer[512];
//< Buffer of characters in report
33
unsigned
_bufcount
;
//< How many characters we have so far
34
35
int
_null_radius
;
//< The range over which no motion should be reported
36
37
struct
timeval timestamp;
//< Time of the last report from the device
38
39
virtual
void
clear_values(
void
);
//< Set all buttons, analogs and encoders back to 0
40
43
virtual
int
get_report(
void
);
44
46
virtual
void
report_changes
47
(vrpn_uint32 class_of_service
48
=
vrpn_CONNECTION_LOW_LATENCY
);
50
virtual
void
report
51
(vrpn_uint32 class_of_service
52
=
vrpn_CONNECTION_LOW_LATENCY
);
53
54
// NOTE: class_of_service is only applied to vrpn_Analog
55
// values, not vrpn_Button, which are always vrpn_RELIABLE
56
};
57
58
#endif
vrpn_Serial_Analog
Definition:
vrpn_Analog.h:63
vrpn_Button_Filter::report_changes
virtual void report_changes(void)
Definition:
vrpn_Button.C:382
vrpn_Magellan::_bufcount
unsigned _bufcount
Definition:
vrpn_Magellan.h:33
vrpn_Types.h
vrpn_Magellan
Definition:
vrpn_Magellan.h:11
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_Magellan::_altreset
bool _altreset
Definition:
vrpn_Magellan.h:26
vrpn_Magellan::_numbuttons
int _numbuttons
Definition:
vrpn_Magellan.h:28
vrpn_CONNECTION_LOW_LATENCY
const vrpn_uint32 vrpn_CONNECTION_LOW_LATENCY
Definition:
vrpn_Connection.h:122
vrpn_Magellan::_null_radius
int _null_radius
Definition:
vrpn_Magellan.h:35
vrpn_Shared.h
vrpn_Magellan::_numchannels
int _numchannels
Definition:
vrpn_Magellan.h:29
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_Connection.h
vrpn_Magellan::_expected_chars
unsigned _expected_chars
Definition:
vrpn_Magellan.h:31
vrpn_Magellan::_status
int _status
Definition:
vrpn_Magellan.h:27
vrpn_Analog.h
vrpn_Configure.h
vrpn_Magellan::~vrpn_Magellan
~vrpn_Magellan()
Definition:
vrpn_Magellan.h:18
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_Magellan.h
Generated by
1.8.17