RflySimSDK v3.05
RflySimSDK说明文档
载入中...
搜索中...
未找到
vrpn_Analog_5dt.h
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
12class VRPN_API vrpn_5dt: public vrpn_Serial_Analog
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.
定义 vrpn_Analog_5dt.h:13
int send_command(const unsigned char *cmd, int len)
virtual void mainloop()
Called once through each main loop iteration to handle updates.
virtual void report(vrpn_uint32 class_of_service=vrpn_CONNECTION_LOW_LATENCY)
send report whether or not changed
vrpn_5dt(const char *name, vrpn_Connection *c, const char *port, int baud=19200, int mode=1, bool tenbytes=false)
Constructor.
virtual void report_changes(vrpn_uint32 class_of_service=vrpn_CONNECTION_LOW_LATENCY)
send report iff changed
Generic connection class not specific to the transport mechanism.
定义 vrpn_Connection.h:562
定义 vrpn_Analog.h:63