RflySimSDK v3.05
RflySimSDK说明文档
载入中...
搜索中...
未找到
vrpn_Dyna.h
1#ifndef INCLUDED_DYNA
2#define INCLUDED_DYNA
3
4#include "vrpn_Configure.h" // for VRPN_API
5#include "vrpn_Serial.h"
6#include "vrpn_Tracker.h" // for vrpn_Tracker_Serial
7
8class VRPN_API vrpn_Connection;
9
10// only 13 receivers allowed in normal addressing mode
11#define VRPN_DYNA_MAX_SENSORS 13
12
13// This is a class which provides a server for an ascension
14// DynaSight. The server will send out messages
15// The timestamp is the time when the first character was read
16// from the serial driver with "read". No adjustment is currently
17// made to this time stamp.
18
19// If this is running on a non-linux system, then the serial port driver
20// is probably adding more latency -- see the vrpn README for more info.
21
22class VRPN_API vrpn_Tracker_Dyna: public vrpn_Tracker_Serial {
23private:
24 unsigned reportLength;
25 unsigned totalReportLength;
26
27 public:
28
29 vrpn_Tracker_Dyna(char *name, vrpn_Connection *c, int cSensors=1,
30 const char *port = "/dev/ttyd3", long baud = 38400);
31
32 virtual ~vrpn_Tracker_Dyna();
33
34private:
35 void my_flush() {
36 // clear the input data buffer
37 unsigned char foo[128];
38 while (vrpn_read_available_characters(serial_fd, foo, 1) > 0) ;
39 }
40 int valid_report();
41 int decode_record();
42 int get_status();
43 protected:
44
45 virtual int get_report(void);
46 virtual void reset();
47 void printError(unsigned char uchErrCode, unsigned char uchExpandedErrCode);
48 int checkError();
49 int cResets;
50 int cSensors;
51};
52
53
54#endif
Generic connection class not specific to the transport mechanism.
定义 vrpn_Connection.h:562
定义 vrpn_Dyna.h:22
virtual int get_report(void)
virtual void reset()
Reset the tracker.
定义 vrpn_Tracker.h:144
vrpn_Serial: Pulls all the serial port routines into one file to make porting to new operating system...