vrpn
07.35
Virtual Reality Peripheral Network
Toggle main menu visibility
Loading...
Searching...
No Matches
vrpn_GlobalHapticsOrb.h
Go to the documentation of this file.
1
#ifndef VRPN_GLOBALHAPTICSORB_H
2
#define VRPN_GLOBALHAPTICSORB_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, VRPN_CALLBACK
7
#include "
vrpn_Connection.h
"
// for vrpn_CONNECTION_RELIABLE, etc
8
#include "
vrpn_Dial.h
"
// for vrpn_Dial
9
#include "
vrpn_Shared.h
"
// for timeval
10
#include "
vrpn_Types.h
"
// for vrpn_uint32
11
12
// Exports buttons 0-25 as 0-25.
13
// Exports left pushbutton as 26, right pushbutton as 27.
14
// Exports rocker up as 28, rocker down as 29.
15
// Exports Thumbwheel both as clamping analog (-1..1) 0 and as dial 0.
16
// Exports Trackball both as clamping analogs 1 and 2 and as dials 1 and 2.
17
18
class
VRPN_API
vrpn_GlobalHapticsOrb
:
public
vrpn_Serial_Analog
19
,
public
vrpn_Button_Filter
20
,
public
vrpn_Dial
21
{
22
public
:
23
vrpn_GlobalHapticsOrb
(
const
char
* name,
vrpn_Connection
* c,
24
const
char
* port,
int
baud);
25
~vrpn_GlobalHapticsOrb
() {};
26
27
// Called once through each main loop iteration to handle
28
// updates.
29
virtual
void
mainloop
();
30
31
protected
:
32
int
d_status
;
33
34
unsigned
d_expected_chars
;
//< How many characters to expect in the report
35
unsigned
char
d_buffer
[512];
//< Buffer of characters in report
36
unsigned
d_bufcount
;
//< How many characters we have so far
37
38
struct
timeval
d_timestamp
;
//< Time of the last report from the device
39
40
virtual
void
clear_values
(
void
);
//< Set all buttons, analogs and encoders back to 0
41
virtual
int
reset
(
void
);
//< Set device back to starting config
42
virtual
int
get_report
(
void
);
//< Try to read a report from the device
43
44
// NOTE: class_of_service is only applied to vrpn_Analog
45
// values, not vrpn_Button or vrpn_Dial
47
virtual
void
report_changes
(vrpn_uint32 class_of_service
48
=
vrpn_CONNECTION_RELIABLE
);
50
virtual
void
report
(vrpn_uint32 class_of_service
51
=
vrpn_CONNECTION_RELIABLE
);
52
54
static
int
VRPN_CALLBACK
handle_firstConnection
(
void
*
userdata
,
vrpn_HANDLERPARAM
);
55
};
56
57
#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_BaseClassUnique::userdata
void * userdata
Definition
vrpn_BaseClass.h:290
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_Dial::vrpn_Dial
vrpn_Dial(const char *name, vrpn_Connection *c=NULL)
Definition
vrpn_Dial.C:8
vrpn_GlobalHapticsOrb::vrpn_GlobalHapticsOrb
vrpn_GlobalHapticsOrb(const char *name, vrpn_Connection *c, const char *port, int baud)
Definition
vrpn_GlobalHapticsOrb.C:47
vrpn_GlobalHapticsOrb::d_expected_chars
unsigned d_expected_chars
Definition
vrpn_GlobalHapticsOrb.h:34
vrpn_GlobalHapticsOrb::d_timestamp
struct timeval d_timestamp
Definition
vrpn_GlobalHapticsOrb.h:38
vrpn_GlobalHapticsOrb::clear_values
virtual void clear_values(void)
Definition
vrpn_GlobalHapticsOrb.C:71
vrpn_GlobalHapticsOrb::~vrpn_GlobalHapticsOrb
~vrpn_GlobalHapticsOrb()
Definition
vrpn_GlobalHapticsOrb.h:25
vrpn_GlobalHapticsOrb::d_status
int d_status
Definition
vrpn_GlobalHapticsOrb.h:32
vrpn_GlobalHapticsOrb::get_report
virtual int get_report(void)
Definition
vrpn_GlobalHapticsOrb.C:152
vrpn_GlobalHapticsOrb::d_buffer
unsigned char d_buffer[512]
Definition
vrpn_GlobalHapticsOrb.h:35
vrpn_GlobalHapticsOrb::handle_firstConnection
static int VRPN_CALLBACK handle_firstConnection(void *userdata, vrpn_HANDLERPARAM)
Clear all of the values when we get our first client connection request.
Definition
vrpn_GlobalHapticsOrb.C:33
vrpn_GlobalHapticsOrb::d_bufcount
unsigned d_bufcount
Definition
vrpn_GlobalHapticsOrb.h:36
vrpn_GlobalHapticsOrb::reset
virtual int reset(void)
Definition
vrpn_GlobalHapticsOrb.C:91
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_HANDLERPARAM
This structure is what is passed to a vrpn_Connection message callback.
Definition
vrpn_Connection.h:41
vrpn_Analog.h
vrpn_Button.h
vrpn_Configure.h
VRPN_API
#define VRPN_API
Definition
vrpn_Configure.h:648
VRPN_CALLBACK
#define VRPN_CALLBACK
Definition
vrpn_Configure.h:649
vrpn_Connection.h
vrpn_CONNECTION_RELIABLE
const vrpn_uint32 vrpn_CONNECTION_RELIABLE
Classes of service for messages, specify multiple by ORing them together Priority of satisfying these...
Definition
vrpn_Connection.h:118
vrpn_Dial.h
vrpn_Shared.h
vrpn_Types.h
vrpn_GlobalHapticsOrb.h
Generated by
1.17.0