11#if defined(VRPN_USE_WIIUSE)
20#define VRPN_WIIUSE_MAX_WIIMOTES 4
24class vrpn_Wiimote_Device;
26#ifdef vrpn_THREADS_AVAILABLE
27struct vrpn_WiiMote_SharedData;
132 ,
unsigned useMS = 1,
unsigned useIR = 1,
unsigned reorderButtons = 0,
133 const char *bdaddr = NULL);
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) {
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(const char *name, vrpn_Connection *c=NULL)
vrpn_Analog(const char *name, vrpn_Connection *c=NULL)
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 ...
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...
vrpn_Connection * d_connection
Connection that this object talks to.
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
Called once through each main loop iteration to handle updates. Remote object mainloop() should call ...
Generic connection class not specific to the transport mechanism.
static int VRPN_CALLBACK handle_request_message(void *userdata, vrpn_HANDLERPARAM p)
vrpn_WiiMote(const char *name, vrpn_Connection *c=NULL, unsigned which=0, unsigned useMS=1, unsigned useIR=1, unsigned reorderButtons=0, const char *bdaddr=NULL)
static int VRPN_CALLBACK handle_request_channels_message(void *userdata, vrpn_HANDLERPARAM p)
static int VRPN_CALLBACK handle_last_connection_dropped(void *selfPtr, vrpn_HANDLERPARAM data)
This structure is what is passed to a vrpn_Connection message callback.
const vrpn_uint32 vrpn_CONNECTION_LOW_LATENCY
#define vrpn_gettimeofday