9#include "vrpn_Configure.h"
11#if defined(VRPN_USE_WIIUSE)
13#include "vrpn_Analog.h"
14#include "vrpn_Analog_Output.h"
15#include "vrpn_Button.h"
16#include "vrpn_Connection.h"
17#include "vrpn_Shared.h"
20#define VRPN_WIIUSE_MAX_WIIMOTES 4
24class vrpn_Wiimote_Device;
26#ifdef vrpn_THREADS_AVAILABLE
27struct vrpn_WiiMote_SharedData;
131 vrpn_WiiMote(
const char *name,
vrpn_Connection *c = NULL,
unsigned which = 0
132 ,
unsigned useMS = 1,
unsigned useIR = 1,
unsigned reorderButtons = 0,
133 const char *bdaddr = NULL);
138 bool isValid()
const;
142 static int VRPN_CALLBACK handle_request_message(
void *userdata,
144 static int VRPN_CALLBACK handle_request_channels_message(
void* userdata,
146 static int VRPN_CALLBACK handle_last_connection_dropped(
void *selfPtr,
vrpn_HANDLERPARAM data);
153 void acquireMessageLock();
154 void releaseMessageLock();
156#ifdef vrpn_THREADS_AVAILABLE
160 bool waitingForConnection;
162 vrpn_WiiMote_SharedData *sharedData;
166 struct timeval last_reconnect_attempt
169 vrpn_Wiimote_Device *wiimote;
171 wiimote_t **available_wiimotes;
174 inline void FAIL(
const char *msg) {
176 vrpn_gettimeofday(&now, NULL);
186 void report_changes(vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY);
192 void report(vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY);
195 struct timeval _timestamp;
198 void initialize_wiimote_state(
void);
201 void handle_event(
void);
204 void connect_wiimote(
int timeout);
207 unsigned map_button(
unsigned btn);
定义 vrpn_Analog_Output.h:26
virtual void report(vrpn_uint32 class_of_service=vrpn_CONNECTION_LOW_LATENCY, const struct timeval time=vrpn_ANALOG_NOW)
virtual void report_changes(vrpn_uint32 class_of_service=vrpn_CONNECTION_LOW_LATENCY, const struct timeval time=vrpn_ANALOG_NOW)
int send_text_message(const char *msg, struct timeval timestamp, vrpn_TEXT_SEVERITY type=vrpn_TEXT_NORMAL, vrpn_uint32 level=0)
Sends a NULL-terminated text message from the device d_sender_id
virtual void mainloop()=0
Generic connection class not specific to the transport mechanism.
定义 vrpn_Connection.h:562
This structure is what is passed to a vrpn_Connection message callback.
定义 vrpn_Connection.h:41