30#ifndef VRPN_HUMANINTERFACE_H
31#define VRPN_HUMANINTERFACE_H
36#include "vrpn_Configure.h"
37#include "vrpn_Types.h"
43 wchar_t *serial_number;
44 wchar_t *manufacturer_string;
45 wchar_t *product_string;
60 virtual void reset() {}
63#if defined(VRPN_USE_HID)
67typedef struct hid_device_ hid_device;
80 vrpn_uint16 vendor = 0,
82 vrpn_uint16 product = 0,
84 hid_device *device = NULL);
105 const char *device_path,
109 vrpn_uint16 vendor = 0,
111 vrpn_uint16 product = 0);
178 vrpn_uint16 m_vendor;
179 vrpn_uint16 m_product;
198 void print_error(
const char *function,
const char *msg,
199 bool askHIDAPI =
true)
const;
201 void print_hidapi_error(
const char *function)
const;
202 hid_device *m_device;
226 return (device.vendor == vendor) && (device.product == product);
230 vrpn_uint16 product, vendor;
242 return !wcscmp(devNum, device.serial_number);
246 const wchar_t *devNum;
259 return _iface == device.interface_number;
285 return delegate->accept(device) && (found++ == target);
294 size_t target, found;
312 bool p = first->accept(device);
313 bool q = second->accept(device);
342 bool p = first->accept(device);
343 bool q = second->accept(device);
定义 vrpn_HumanInterface.h:56
定义 vrpn_HumanInterface.h:211
定义 vrpn_HumanInterface.h:300
定义 vrpn_HumanInterface.h:330
定义 vrpn_HumanInterface.h:251
定义 vrpn_HumanInterface.h:70
int get_feature_report(size_t bytes, vrpn_uint8 *buffer)
vrpn_HidAcceptor * m_acceptor
This is the HidAcceptor we use when reconnecting.
定义 vrpn_HumanInterface.h:175
vrpn_uint16 product() const
virtual void on_data_received(size_t bytes, vrpn_uint8 *buffer)=0
Derived class reimplements this callback. It is called whenever a read returns some data.
vrpn_HidInterface(vrpn_HidAcceptor *acceptor, vrpn_uint16 vendor=0, vrpn_uint16 product=0, hid_device *device=NULL)
vrpn_HidInterface(const char *device_path, vrpn_HidAcceptor *acceptor, vrpn_uint16 vendor=0, vrpn_uint16 product=0)
int interface_number() const
virtual bool connected() const
Returns true iff the last device I/O succeeded
void send_data(size_t bytes, const vrpn_uint8 *buffer)
Call this to send data to the device
vrpn_uint16 vendor() const
vrpn_HidInterface(vrpn_HidAcceptor *acceptor, hid_device *device)
vrpn_uint16 m_vendor_sought
What vendor we want
定义 vrpn_HumanInterface.h:190
void send_feature_report(size_t bytes, const vrpn_uint8 *buffer)
vrpn_uint16 m_product_sought
What product we want
定义 vrpn_HumanInterface.h:191
Accepts the Nth device matching a given acceptor.
定义 vrpn_HumanInterface.h:272
Accepts any device with the given vendor and product IDs.
定义 vrpn_HumanInterface.h:217
Accepts any device with a particular serial number.
定义 vrpn_HumanInterface.h:234
定义 vrpn_HumanInterface.h:40