vrpn 07.35
Virtual Reality Peripheral Network
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
13{
14public:
26 vrpn_5dt (const char * name,
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
Class to support reading data from serial 5DT data gloves.
unsigned _expected_chars
unsigned _bufcount
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
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
virtual void mainloop()=0
Called once through each main loop iteration to handle updates. Remote object mainloop() should call ...
Generic connection class not specific to the transport mechanism.
#define VRPN_API
const vrpn_uint32 vrpn_CONNECTION_LOW_LATENCY