#ifndef VRPN_SPACEBALL_H
#define VRPN_SPACEBALL_H
#include "vrpn_Connection.h"
#include "vrpn_Analog.h"
#include "vrpn_Button.h"
class vrpn_Spaceball: public vrpn_Serial_Analog
,public vrpn_Button
{
public:
vrpn_Spaceball (const char * name, vrpn_Connection * c,
const char * port, int baud);
~vrpn_Spaceball () {};
virtual void mainloop ();
virtual int reset(void);
protected:
int _numbuttons;
int _numchannels;
unsigned char buf[512];
int bufpos;
int packtype;
int packlen;
int escapedchar;
int erroroccured;
int resetoccured;
int spaceball4000;
int leftymode4000;
int null_radius;
struct timeval timestamp;
virtual void clear_values(void);
virtual int get_report(void);
virtual void report_changes
(vrpn_uint32 class_of_service
= vrpn_CONNECTION_LOW_LATENCY);
virtual void report
(vrpn_uint32 class_of_service
= vrpn_CONNECTION_LOW_LATENCY);
// NOTE: class_of_service is only applied to vrpn_Analog
// values, not vrpn_Button, which are always vrpn_RELIABLE
};
#endif