5#include "vrpn_Analog.h"
7#include "vrpn_Button.h"
8#include "vrpn_Configure.h"
9#include "vrpn_Connection.h"
11#include "vrpn_HumanInterface.h"
12#include "vrpn_Shared.h"
13#include "vrpn_Types.h"
15#if defined(VRPN_USE_HID)
45 bool toggle_light =
true);
60 virtual void decodePacket(
size_t bytes, vrpn_uint8 *buffer) = 0;
64 typedef enum { Off, On, Flash } LED_STATE;
65 virtual void setLEDs(LED_STATE red, LED_STATE green) = 0;
67 struct timeval _timestamp;
81 bool toggle_light =
true)
85 virtual void setLEDs(LED_STATE, LED_STATE) {};
93 bool toggle_light =
true)
96 if (_toggle_light) { setLEDs(On, Off); }
102 virtual void setLEDs(LED_STATE red, LED_STATE green);
110 bool toggle_light =
true)
113 if (_toggle_light) { setLEDs(On, Off); }
119 virtual void setLEDs(LED_STATE red, LED_STATE green);
131 void report_changes (
void);
135 void decodePacket(
size_t bytes, vrpn_uint8 *buffer);
147 void report_changes (
void);
151 void decodePacket(
size_t bytes, vrpn_uint8 *buffer);
164 void report_changes (vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY);
166 void report (vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY);
170 void decodePacket(
size_t bytes, vrpn_uint8 *buffer);
174 vrpn_uint8 _lastDial;
187 void report_changes(vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY);
189 void report(vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY);
193 void decodePacket(
size_t bytes, vrpn_uint8 *buffer);
197 vrpn_uint8 _lastDial;
210 void report_changes (vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY);
212 void report (vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY);
216 void decodePacket(
size_t bytes, vrpn_uint8 *buffer);
219 vrpn_uint8 _lastDial;
232 void report_changes(vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY);
234 void report(vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY);
238 void decodePacket(
size_t bytes, vrpn_uint8 *buffer);
241 vrpn_uint8 _lastDial;
254 void report_changes(vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY);
256 void report(vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY);
260 void decodePacket(
size_t bytes, vrpn_uint8 *buffer);
263 vrpn_uint8 _lastDial;
275 void report_changes (
void);
279 void decodePacket(
size_t bytes, vrpn_uint8 *buffer);
Generic connection class not specific to the transport mechanism.
定义 vrpn_Connection.h:562
定义 vrpn_HumanInterface.h:56
定义 vrpn_HumanInterface.h:70
vrpn_uint16 product() const
vrpn_uint16 vendor() const
void on_data_received(size_t bytes, vrpn_uint8 *buffer)
Derived class reimplements this callback. It is called whenever a read returns some data.
virtual void mainloop()=0
int register_types(void)
定义 vrpn_Xkeys.h:72
This structure is what is passed to a vrpn_Connection message callback.
定义 vrpn_Connection.h:41