1#ifndef VRPN_IMMERSIONBOX_H
2#define VRPN_IMMERSIONBOX_H
24 const int numchannels,
25 const int numencoders);
46 virtual int reset(
void);
59#define MAX_IENCODERS 6
60#define MAX_ICHANNELS 8
62#define MAX_IBOX_STRING 32
65 int syncBaudrate (
double seconds);
68 int sendIboxCommand (
char cmd,
char * returnString,
double delay);
81 unsigned char commandByte;
82 unsigned char dataPacketHeader;
88 inline void setupCommand (
int useTimeStamp,
89 unsigned int numAnalog,
90 unsigned int numEncoder) {
91 commandByte = (
unsigned char) (
92 (useTimeStamp ? 0x20 : 0) |
93 (numAnalog > 4 ? 0x0C : (numAnalog > 2 ? 0x08 : (numAnalog ? 0x04 : 0 ) ) ) |
94 (numEncoder > 3 ? 0x03 : (numEncoder > 2 ? 0x02 : (numEncoder ? 0x01 : 0 ) ) ) );
96 dataPacketHeader = (
unsigned char)(commandByte | 0x80);
103 dataRecordLength = 1 + (useTimeStamp ? 2 : 0) +
104 (numAnalog > 4 ? 9 :(numAnalog > 2 ? 5: (numAnalog ? 3 : 0 ) ) ) +
105 (numEncoder > 4 ? 12 :(numEncoder > 2 ? 8: (numEncoder ? 4: 0 ) ) );
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 ...
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...
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.
vrpn_Dial(const char *name, vrpn_Connection *c=NULL)
virtual int get_report(void)
virtual void clear_values(void)
vrpn_ImmersionBox(const char *name, vrpn_Connection *c, const char *port, int baud, const int numbuttons, const int numchannels, const int numencoders)
unsigned char _buffer[512]
vrpn_Serial_Analog(const char *name, vrpn_Connection *connection, const char *port, int baud=9600, int bits=8, vrpn_SER_PARITY parity=vrpn_SER_PARITY_NONE, bool rts_flow=false)
const vrpn_uint32 vrpn_CONNECTION_LOW_LATENCY