vrpn 07.35
Virtual Reality Peripheral Network
Loading...
Searching...
No Matches
vrpn_Analog_5dtUSB.h
Go to the documentation of this file.
1
14#ifndef VRPN_ANALOG_5DTUSB_H
15#define VRPN_ANALOG_5DTUSB_H
16
17#include <stddef.h> // for size_t
18#include <string> // for string
19
20#include "vrpn_Analog.h" // for vrpn_Analog
21#include "vrpn_Configure.h" // for VRPN_API, VRPN_USE_HID
22#include "vrpn_Connection.h" // for vrpn_Connection (ptr only), etc
23#include "vrpn_HumanInterface.h" // for vrpn_HIDDEVINFO, etc
24#include "vrpn_Shared.h" // for timeval
25#include "vrpn_Types.h" // for vrpn_uint16, vrpn_uint32, etc
26
27#if defined(VRPN_USE_HID)
28
52 public:
54 virtual ~vrpn_Analog_5dtUSB();
55
57 virtual void mainloop();
58
61 std::string get_description() const;
62
64 bool isLeftHand() const { return _isLeftHand; }
65
67 bool isRightHand() const { return !_isLeftHand; }
68
69 protected:
71 // NOTE: Because this can accept a variety of productIds, we cannot use the
72 // optimization of asking for a vendor and product ID in the constructor
73 // of the vrpn_HidInterface -- it will not understand about the masks.
74 vrpn_Analog_5dtUSB(vrpn_HidAcceptor *filter, int num_sensors,
75 bool isLeftHand, const char *name, vrpn_Connection *c = 0);
77 void on_data_received(size_t bytes, vrpn_uint8 *buffer);
78
80 struct timeval _timestamp;
81
84 double _rawVals[16];
85
88
93
95 void report_changes(vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY);
97 void report(vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY);
98};
99
106
113
121
129
133 public:
134 vrpn_HidProductMaskAcceptor(vrpn_uint16 vendorId, vrpn_uint16 productMask = 0x0000, vrpn_uint16 desiredProduct = 0x0000) :
135 vendor(vendorId),
136 product(desiredProduct),
137 mask(productMask) {}
138
140
141 bool accept(const vrpn_HIDDEVINFO &device) {
142 return (device.vendor == vendor) && ((device.product & mask) == (product & mask));
143 }
144 private:
145 vrpn_uint16 vendor;
146 vrpn_uint16 product;
147 vrpn_uint16 mask;
148};
149
150#endif // end of ifdef VRPN_USE_HID
151
152// end of VRPN_ANALOG_5DTUSB_H
153#endif
154
Specialization of vrpn_Analog_5dtUSB for a 14-sensor, left-hand glove. Not tested as of 8-Mar-2011 be...
Specialization of vrpn_Analog_5dtUSB for a 14-sensor, right-hand glove. Not tested as of 8-Mar-2011 b...
Specialization of vrpn_Analog_5dtUSB for a 5-sensor, left-hand glove.
Specialization of vrpn_Analog_5dtUSB for a 5-sensor, right-hand glove.
5th Dimension Technologies (5dt) "Ultra" USB data glove driver
bool _wasConnected
Flag indicating whether we were connected last time through the mainloop. Used to send a "normal"-sev...
bool isRightHand() const
Accessor to know if this is a right hand glove.
bool isLeftHand() const
Accessor to know if this is a left hand glove.
bool _isLeftHand
Flag for left handedness.
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 ...
Definition vrpn_Analog.C:94
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...
Definition vrpn_Analog.C:71
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_uint16 product() const
Returns USB product ID of connected device May not contain valid if an already-open device was provid...
virtual void on_data_received(size_t bytes, vrpn_uint8 *buffer)=0
Derived class reimplements this callback.
vrpn_uint16 vendor() const
Returns USB vendor ID of connected device May not contain valid if an already-open device was provide...
HID acceptor subclass used by vrpn_Analog_5dtUSB since the bits of the product ID for these devices d...
vrpn_HidProductMaskAcceptor(vrpn_uint16 vendorId, vrpn_uint16 productMask=0x0000, vrpn_uint16 desiredProduct=0x0000)
bool accept(const vrpn_HIDDEVINFO &device)
#define VRPN_API
const vrpn_uint32 vrpn_CONNECTION_LOW_LATENCY