11#if defined(VRPN_USE_HID)
14static const vrpn_uint16 DREAMCHEEKY_VENDOR = 6465;
15static const vrpn_uint16 USB_ROLL_UP_DRUM_KIT = 32801;
31 fprintf(stderr,
"vrpn_DreamCheeky::~vrpn_DreamCheeky(): delete failed\n");
96 for (i = 0; i < (bytes / 8); i++) {
105 vrpn_uint8 mask = 1 << btn;
106 for (r = 0; r < 8; r++) {
107 vrpn_uint8 *
report = buffer + 9*i + r;
108 count += ((*
report & mask) != 0);
118 for (r = 0; r < 8; r++) {
119 vrpn_uint8 *
report = buffer + 9*i + r;
122 vrpn_uint8 mask = 1 << btn;
void server_mainloop(void)
Handles functions that all servers should provide in their mainloop() (ping/pong, for example) Should...
vrpn_BaseClass(const char *name, vrpn_Connection *c=NULL)
Names the device and assigns or opens connection, calls registration methods.
Generic connection class not specific to the transport mechanism.
void decodePacket(size_t bytes, vrpn_uint8 *buffer)
virtual void mainloop()
Called once through each main loop iteration to handle updates. Remote object mainloop() should call ...
void report_changes(void)
vrpn_DreamCheeky_Drum_Kit(const char *name, vrpn_Connection *c=0, bool debounce=true)
struct timeval _timestamp
vrpn_HidAcceptor * _filter
void on_data_received(size_t bytes, vrpn_uint8 *buffer)
Derived class reimplements this callback.
virtual ~vrpn_DreamCheeky()
virtual void decodePacket(size_t bytes, vrpn_uint8 *buffer)=0
vrpn_DreamCheeky(vrpn_HidAcceptor *filter, const char *name, vrpn_Connection *c=0, vrpn_uint16 vendor=0, vrpn_uint16 product=0)
vrpn_uint16 product() const
Returns USB product ID of connected device May not contain valid if an already-open device was provid...
vrpn_HidInterface(vrpn_HidAcceptor *acceptor, vrpn_uint16 vendor=0, vrpn_uint16 product=0, hid_device *device=NULL)
Constructor If we already have a HID device from some other source, it can be passed and we'll take o...
virtual void update()
Polls the device buffers and causes on_data_received callbacks if appropriate You NEED to call this f...
vrpn_uint16 vendor() const
Returns USB vendor ID of connected device May not contain valid if an already-open device was provide...
Accepts any device with the given vendor and product IDs.
#define vrpn_gettimeofday