-
Notifications
You must be signed in to change notification settings - Fork 1
/
vrpn_Dyna.h
51 lines (39 loc) · 1.31 KB
/
vrpn_Dyna.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#ifndef INCLUDED_DYNA
#define INCLUDED_DYNA
#include "vrpn_Tracker.h"
#include "vrpn_Serial.h"
// only 13 receivers allowed in normal addressing mode
#define MAX_SENSORS 13
// This is a class which provides a server for an ascension
// DynaSight. The server will send out messages
// The timestamp is the time when the first character was read
// from the serial driver with "read". No adjustment is currently
// made to this time stamp.
// If this is running on a non-linux system, then the serial port driver
// is probably adding more latency -- see the vrpn README for more info.
class VRPN_API vrpn_Tracker_Dyna: public vrpn_Tracker_Serial {
private:
unsigned reportLength;
unsigned totalReportLength;
public:
vrpn_Tracker_Dyna(char *name, vrpn_Connection *c, int cSensors=1,
const char *port = "/dev/ttyd3", long baud = 38400);
virtual ~vrpn_Tracker_Dyna();
private:
void my_flush() {
// clear the input data buffer
unsigned char foo[128];
while (vrpn_read_available_characters(serial_fd, foo, 1) > 0) ;
}
int valid_report();
int decode_record();
int get_status();
protected:
virtual int get_report(void);
virtual void reset();
void printError(unsigned char uchErrCode, unsigned char uchExpandedErrCode);
int checkError();
int cResets;
int cSensors;
};
#endif