RflySimSDK v3.05
RflySimSDK说明文档
载入中...
搜索中...
未找到
vrpn_Vality.h
1#pragma once
2
3#include <stddef.h> // for size_t
4
5#include "vrpn_Analog.h" // for vrpn_Analog
6#include "vrpn_BaseClass.h" // for vrpn_BaseClass
7#include "vrpn_Configure.h" // for VRPN_CALLBACK, VRPN_USE_HID
8#include "vrpn_Connection.h" // for vrpn_CONNECTION_LOW_LATENCY, etc
9#include "vrpn_HumanInterface.h" // for vrpn_HidAcceptor (ptr only), etc
10#include "vrpn_Shared.h" // for timeval
11#include "vrpn_Types.h" // for vrpn_uint8, vrpn_uint32
12
13#if defined(VRPN_USE_HID)
14
15// Device drivers for the Vality USB line of products
16// Currently supported: vGlass
17
19public:
20 vrpn_Vality(vrpn_HidAcceptor *filter, const char *name,
21 vrpn_Connection *c = 0,
22 vrpn_uint16 vendor = 0, vrpn_uint16 product = 0);
23 virtual ~vrpn_Vality(void);
24
25 virtual void mainloop(void) = 0;
26
27protected:
28 // Set up message handlers, etc.
29 void init_hid(void);
30 void on_data_received(size_t bytes, vrpn_uint8 *buffer);
31
32 static int VRPN_CALLBACK on_connect(void *thisPtr, vrpn_HANDLERPARAM p);
33 static int VRPN_CALLBACK on_last_disconnect(void *thisPtr, vrpn_HANDLERPARAM p);
34
35 virtual void decodePacket(size_t bytes, vrpn_uint8 *buffer) = 0;
36 struct timeval _timestamp;
37 vrpn_HidAcceptor *_filter;
38
39 // No actual types to register, derived classes will be buttons, analogs, and/or dials
40 int register_types(void) { return 0; }
41};
42
44 public vrpn_Analog {
45public:
46 vrpn_Vality_vGlass(const char *name, vrpn_Connection *c = 0);
47 virtual ~vrpn_Vality_vGlass(void){};
48
49 virtual void mainloop(void);
50
51protected:
52 // Send report iff changed
53 void report_changes (vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY);
54 // Send report whether or not changed
55 void report (vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY);
56
57 void decodePacket(size_t bytes, vrpn_uint8 *buffer);
58};
59
60// end of VRPN_USE_HID
61#else
62class VRPN_API vrpn_Vality;
63class VRPN_API vrpn_Vality_ShuttleXpress;
64class VRPN_API vrpn_Vality_ShuttlePROv2;
65#endif
定义 vrpn_Analog.h:28
定义 vrpn_BaseClass.h:310
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
定义 vrpn_Vality.h:44
virtual void mainloop(void)
定义 vrpn_Vality.h:18
virtual void mainloop(void)=0
void on_data_received(size_t bytes, vrpn_uint8 *buffer)
Derived class reimplements this callback. It is called whenever a read returns some data.
int register_types(void)
定义 vrpn_Vality.h:40
This structure is what is passed to a vrpn_Connection message callback.
定义 vrpn_Connection.h:41