vrpn
07.35
Virtual Reality Peripheral Network
Toggle main menu visibility
Loading...
Searching...
No Matches
vrpn_Analog_5dt.h
Go to the documentation of this file.
1
#ifndef VRPN_5DT_H
2
#define VRPN_5DT_H
3
4
#include "
vrpn_Analog.h
"
// for vrpn_Serial_Analog
5
#include "
vrpn_Configure.h
"
// for VRPN_API
6
#include "
vrpn_Connection.h
"
// for vrpn_CONNECTION_LOW_LATENCY, etc
7
#include "
vrpn_Shared.h
"
// for timeval
8
#include "
vrpn_Types.h
"
// for vrpn_uint32
9
12
class
VRPN_API
vrpn_5dt
:
public
vrpn_Serial_Analog
13
{
14
public
:
26
vrpn_5dt
(
const
char
* name,
27
vrpn_Connection
* c,
28
const
char
* port,
29
int
baud = 19200,
30
int
mode = 1,
31
bool
tenbytes =
false
);
32
34
virtual
void
mainloop
();
35
36
void
syncing
(
void
);
37
38
protected
:
39
bool
_announced
;
//< Did we make the note about potential warnings yet?
40
bool
_wireless
;
//< Whether this glove is using the wireless protocol
41
bool
_gotInfo
;
//< Whether we've sent a message about this wireless glove
42
int
_status
;
//< Reset, Syncing, or Reading
43
int
_numchannels
;
//< How many analog channels to open
44
int
_mode
;
//< glove mode for reporting data (see glove manual)
45
unsigned
_expected_chars
;
//< How many characters to expect in the report
46
unsigned
char
_buffer
[512];
//< Buffer of characters in report
47
unsigned
_bufcount
;
//< How many characters we have so far
48
bool
_tenbytes
;
//< Whether there are 10-byte responses (unusual, but seen)
49
50
struct
timeval
timestamp
;
//< Time of the last report from the device
51
52
virtual
int
reset
(
void
);
//< Set device back to starting config
53
virtual
void
get_report
(
void
);
//< Try to read a report from the device
54
55
virtual
void
clear_values
(
void
);
//< Clears all channels to 0
56
59
int
send_command
(
const
unsigned
char
*cmd,
int
len);
60
62
virtual
void
report_changes
63
(vrpn_uint32 class_of_service =
vrpn_CONNECTION_LOW_LATENCY
);
65
virtual
void
report
66
(vrpn_uint32 class_of_service =
vrpn_CONNECTION_LOW_LATENCY
);
67
};
68
69
#endif
vrpn_5dt::_announced
bool _announced
Definition
vrpn_Analog_5dt.h:39
vrpn_5dt::_expected_chars
unsigned _expected_chars
Definition
vrpn_Analog_5dt.h:45
vrpn_5dt::clear_values
virtual void clear_values(void)
Definition
vrpn_Analog_5dt.C:86
vrpn_5dt::_buffer
unsigned char _buffer[512]
Definition
vrpn_Analog_5dt.h:46
vrpn_5dt::vrpn_5dt
vrpn_5dt(const char *name, vrpn_Connection *c, const char *port, int baud=19200, int mode=1, bool tenbytes=false)
Constructor.
Definition
vrpn_Analog_5dt.C:35
vrpn_5dt::_mode
int _mode
Definition
vrpn_Analog_5dt.h:44
vrpn_5dt::_status
int _status
Definition
vrpn_Analog_5dt.h:42
vrpn_5dt::reset
virtual int reset(void)
Definition
vrpn_Analog_5dt.C:127
vrpn_5dt::_numchannels
int _numchannels
Definition
vrpn_Analog_5dt.h:43
vrpn_5dt::get_report
virtual void get_report(void)
Definition
vrpn_Analog_5dt.C:280
vrpn_5dt::timestamp
struct timeval timestamp
Definition
vrpn_Analog_5dt.h:50
vrpn_5dt::_wireless
bool _wireless
Definition
vrpn_Analog_5dt.h:40
vrpn_5dt::_bufcount
unsigned _bufcount
Definition
vrpn_Analog_5dt.h:47
vrpn_5dt::_tenbytes
bool _tenbytes
Definition
vrpn_Analog_5dt.h:48
vrpn_5dt::syncing
void syncing(void)
Definition
vrpn_Analog_5dt.C:225
vrpn_5dt::_gotInfo
bool _gotInfo
Definition
vrpn_Analog_5dt.h:41
vrpn_5dt::send_command
int send_command(const unsigned char *cmd, int len)
Compute the CRC for the message, append it, and send message. Returns 0 on success,...
Definition
vrpn_Analog_5dt.C:105
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_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_Analog.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_Analog_5dt.h
Generated by
1.17.0