vrpn  07.33
Virtual Reality Peripheral Network
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 {
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_Serial_Analog
Definition: vrpn_Analog.h:63
vrpn_Types.h
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_5dt::_numchannels
int _numchannels
Definition: vrpn_Analog_5dt.h:43
vrpn_5dt::_wireless
bool _wireless
Definition: vrpn_Analog_5dt.h:40
vrpn_CONNECTION_LOW_LATENCY
const vrpn_uint32 vrpn_CONNECTION_LOW_LATENCY
Definition: vrpn_Connection.h:122
vrpn_5dt::_mode
int _mode
Definition: vrpn_Analog_5dt.h:44
vrpn_5dt::_announced
bool _announced
Definition: vrpn_Analog_5dt.h:39
vrpn_Shared.h
vrpn_5dt::_tenbytes
bool _tenbytes
Definition: vrpn_Analog_5dt.h:48
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_5dt
Class to support reading data from serial 5DT data gloves.
Definition: vrpn_Analog_5dt.h:12
vrpn_Analog.h
vrpn_5dt::_gotInfo
bool _gotInfo
Definition: vrpn_Analog_5dt.h:41
vrpn_Configure.h
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_5dt::_bufcount
unsigned _bufcount
Definition: vrpn_Analog_5dt.h:47
vrpn_5dt::_expected_chars
unsigned _expected_chars
Definition: vrpn_Analog_5dt.h:45
VRPN_API
#define VRPN_API
Definition: vrpn_Configure.h:646
vrpn_5dt::_status
int _status
Definition: vrpn_Analog_5dt.h:42