71 #ifndef WIIUSE_H_INCLUDED 72 #define WIIUSE_H_INCLUDED 74 #define WIIUSE_MAJOR 0 75 #define WIIUSE_MINOR 15 76 #define WIIUSE_MICRO 7 78 #define WIIUSE_VERSION_TRANSFORM(MAJ, MIN, MICRO) (MAJ * 1000000 + MIN * 1000 + MICRO) 79 #define WIIUSE_HAS_VERSION(MAJ, MIN, MICRO) \ 80 (WIIUSE_VERSION_TRANSFORM(MAJ, MIN, MICRO) \ 81 <= WIIUSE_VERSION_TRANSFORM(WIIUSE_MAJOR, WIIUSE_MINOR, WIIUSE_MICRO)) 83 #ifndef WIIUSE_PLATFORM 85 #define WIIUSE_PLATFORM 87 #elif defined(__linux) 88 #define WIIUSE_PLATFORM 90 #elif defined(__APPLE__) 91 #define WIIUSE_PLATFORM 94 #error "Platform not yet supported!" 100 #ifndef WIN32_LEAN_AND_MEAN 101 #define WIN32_LEAN_AND_MEAN 1 107 #include <bluetooth/bluetooth.h> 110 #if defined(_MSC_VER) && _MSC_VER < 1700 115 #include "wiiuse_msvcstdint.h" 127 #define WIIMOTE_STATE_DEV_FOUND 0x0001 128 #define WIIMOTE_STATE_HANDSHAKE 0x0002 129 #define WIIMOTE_STATE_HANDSHAKE_COMPLETE 0x0004 130 #define WIIMOTE_STATE_CONNECTED 0x0008 131 #define WIIMOTE_STATE_RUMBLE 0x0010 132 #define WIIMOTE_STATE_ACC 0x0020 133 #define WIIMOTE_STATE_EXP 0x0040 134 #define WIIMOTE_STATE_IR 0x0080 135 #define WIIMOTE_STATE_SPEAKER 0x0100 136 #define WIIMOTE_STATE_IR_SENS_LVL1 0x0200 137 #define WIIMOTE_STATE_IR_SENS_LVL2 0x0400 138 #define WIIMOTE_STATE_IR_SENS_LVL3 0x0800 139 #define WIIMOTE_STATE_IR_SENS_LVL4 0x1000 140 #define WIIMOTE_STATE_IR_SENS_LVL5 0x2000 141 #define WIIMOTE_STATE_EXP_HANDSHAKE 0x10000 142 #define WIIMOTE_STATE_EXP_EXTERN 0x20000 143 #define WIIMOTE_STATE_EXP_FAILED 0x40000 144 #define WIIMOTE_STATE_MPLUS_PRESENT 0x80000 146 #define WIIMOTE_ID(wm) (wm->unid) 148 #define WIIMOTE_IS_SET(wm, s) ((wm->state & (s)) == (s)) 149 #define WIIMOTE_IS_CONNECTED(wm) (WIIMOTE_IS_SET(wm, WIIMOTE_STATE_CONNECTED)) 154 #define WIIMOTE_LED_NONE 0x00 155 #define WIIMOTE_LED_1 0x10 156 #define WIIMOTE_LED_2 0x20 157 #define WIIMOTE_LED_3 0x40 158 #define WIIMOTE_LED_4 0x80 163 #define WIIMOTE_BUTTON_TWO 0x0001 164 #define WIIMOTE_BUTTON_ONE 0x0002 165 #define WIIMOTE_BUTTON_B 0x0004 166 #define WIIMOTE_BUTTON_A 0x0008 167 #define WIIMOTE_BUTTON_MINUS 0x0010 168 #define WIIMOTE_BUTTON_ZACCEL_BIT6 0x0020 169 #define WIIMOTE_BUTTON_ZACCEL_BIT7 0x0040 170 #define WIIMOTE_BUTTON_HOME 0x0080 171 #define WIIMOTE_BUTTON_LEFT 0x0100 172 #define WIIMOTE_BUTTON_RIGHT 0x0200 173 #define WIIMOTE_BUTTON_DOWN 0x0400 174 #define WIIMOTE_BUTTON_UP 0x0800 175 #define WIIMOTE_BUTTON_PLUS 0x1000 176 #define WIIMOTE_BUTTON_ZACCEL_BIT4 0x2000 177 #define WIIMOTE_BUTTON_ZACCEL_BIT5 0x4000 178 #define WIIMOTE_BUTTON_UNKNOWN 0x8000 179 #define WIIMOTE_BUTTON_ALL 0x1F9F 184 #define NUNCHUK_BUTTON_Z 0x01 185 #define NUNCHUK_BUTTON_C 0x02 186 #define NUNCHUK_BUTTON_ALL 0x03 191 #define CLASSIC_CTRL_BUTTON_UP 0x0001 192 #define CLASSIC_CTRL_BUTTON_LEFT 0x0002 193 #define CLASSIC_CTRL_BUTTON_ZR 0x0004 194 #define CLASSIC_CTRL_BUTTON_X 0x0008 195 #define CLASSIC_CTRL_BUTTON_A 0x0010 196 #define CLASSIC_CTRL_BUTTON_Y 0x0020 197 #define CLASSIC_CTRL_BUTTON_B 0x0040 198 #define CLASSIC_CTRL_BUTTON_ZL 0x0080 199 #define CLASSIC_CTRL_BUTTON_FULL_R 0x0200 200 #define CLASSIC_CTRL_BUTTON_PLUS 0x0400 201 #define CLASSIC_CTRL_BUTTON_HOME 0x0800 202 #define CLASSIC_CTRL_BUTTON_MINUS 0x1000 203 #define CLASSIC_CTRL_BUTTON_FULL_L 0x2000 204 #define CLASSIC_CTRL_BUTTON_DOWN 0x4000 205 #define CLASSIC_CTRL_BUTTON_RIGHT 0x8000 206 #define CLASSIC_CTRL_BUTTON_ALL 0xFEFF 211 #define GUITAR_HERO_3_BUTTON_STRUM_UP 0x0001 212 #define GUITAR_HERO_3_BUTTON_YELLOW 0x0008 213 #define GUITAR_HERO_3_BUTTON_GREEN 0x0010 214 #define GUITAR_HERO_3_BUTTON_BLUE 0x0020 215 #define GUITAR_HERO_3_BUTTON_RED 0x0040 216 #define GUITAR_HERO_3_BUTTON_ORANGE 0x0080 217 #define GUITAR_HERO_3_BUTTON_PLUS 0x0400 218 #define GUITAR_HERO_3_BUTTON_MINUS 0x1000 219 #define GUITAR_HERO_3_BUTTON_STRUM_DOWN 0x4000 220 #define GUITAR_HERO_3_BUTTON_ALL 0xFEFF 225 #define TATACON_BUTTON_CENTER_LEFT 0x40 226 #define TATACON_BUTTON_CENTER_RIGHT 0x10 227 #define TATACON_BUTTON_RIM_LEFT 0x20 228 #define TATACON_BUTTON_RIM_RIGHT 0x08 229 #define TATACON_BUTTON_ALL 0x78 234 #define WIIUSE_SMOOTHING 0x01 235 #define WIIUSE_CONTINUOUS 0x02 236 #define WIIUSE_ORIENT_THRESH 0x04 237 #define WIIUSE_INIT_FLAGS (WIIUSE_SMOOTHING | WIIUSE_ORIENT_THRESH) 239 #define WIIUSE_ORIENT_PRECISION 100.0f 245 #define EXP_NUNCHUK 1 246 #define EXP_CLASSIC 2 247 #define EXP_GUITAR_HERO_3 3 248 #define EXP_WII_BOARD 4 249 #define EXP_MOTION_PLUS 5 250 #define EXP_MOTION_PLUS_NUNCHUK 6 251 #define EXP_MOTION_PLUS_CLASSIC 7 252 #define EXP_TATACON 8 266 #define IS_PRESSED(dev, button) ((dev->btns & button) == button) 274 #define IS_HELD(dev, button) ((dev->btns_held & button) == button) 285 #define IS_RELEASED(dev, button) ((dev->btns_released & button) == button) 293 #define IS_JUST_PRESSED(dev, button) (IS_PRESSED(dev, button) && !IS_HELD(dev, button)) 301 #define WIIUSE_GET_IR_SENSITIVITY(wm, lvl) \ 304 if ((wm->state & 0x0200) == 0x0200) \ 306 else if ((wm->state & 0x0400) == 0x0400) \ 308 else if ((wm->state & 0x0800) == 0x0800) \ 310 else if ((wm->state & 0x1000) == 0x1000) \ 312 else if ((wm->state & 0x2000) == 0x2000) \ 318 #define WIIUSE_USING_ACC(wm) ((wm->state & 0x020) == 0x020) 319 #define WIIUSE_USING_EXP(wm) ((wm->state & 0x040) == 0x040) 320 #define WIIUSE_USING_IR(wm) ((wm->state & 0x080) == 0x080) 321 #define WIIUSE_USING_SPEAKER(wm) ((wm->state & 0x100) == 0x100) 323 #define WIIUSE_IS_LED_SET(wm, num) ((wm->leds & WIIMOTE_LED_##num) == WIIMOTE_LED_##num) 331 #define WIIMOTE_DEFAULT_TIMEOUT 10 332 #define WIIMOTE_EXP_TIMEOUT 10 335 #define WIIUSE_SYNC_HANDSHAKE 337 typedef unsigned char byte;
383 int16_t roll, pitch, yaw;
392 float roll, pitch, yaw;
490 unsigned int vres[2];
646 uint8_t update_calib;
647 uint8_t use_alternate_report;
687 float exp_r_shoulder;
688 float exp_l_shoulder;
721 WIIUSE_UNEXPECTED_DISCONNECT,
724 WIIUSE_NUNCHUK_INSERTED,
725 WIIUSE_NUNCHUK_REMOVED,
726 WIIUSE_CLASSIC_CTRL_INSERTED,
727 WIIUSE_CLASSIC_CTRL_REMOVED,
728 WIIUSE_GUITAR_HERO_3_CTRL_INSERTED,
729 WIIUSE_GUITAR_HERO_3_CTRL_REMOVED,
730 WIIUSE_WII_BOARD_CTRL_INSERTED,
731 WIIUSE_WII_BOARD_CTRL_REMOVED,
732 WIIUSE_MOTION_PLUS_ACTIVATED,
733 WIIUSE_MOTION_PLUS_REMOVED,
734 WIIUSE_TATACON_CTRL_INSERTED,
735 WIIUSE_TATACON_CTRL_REMOVED
742 WIIUSE_WIIMOTE_REGULAR = 0,
743 WIIUSE_WIIMOTE_MOTION_PLUS_INSIDE,
769 OVERLAPPED hid_overlap;
790 #ifndef WIIUSE_SYNC_HANDSHAKE 791 byte handshake_state;
816 byte motion_plus_id[6];
831 uint16_t buttons_held;
832 uint16_t buttons_released;
856 typedef enum data_req_s { REQ_READY = 0, REQ_SENT, REQ_DONE } data_req_s;
879 LOGLEVEL_WARNING = 1,
892 #define WIIUSE_EXPORT_DECL 893 #define WIIUSE_IMPORT_DECL 895 #define WIIUSE_EXPORT_DECL __declspec(dllexport) 896 #define WIIUSE_IMPORT_DECL __declspec(dllimport) 899 #define WIIUSE_EXPORT_DECL 900 #define WIIUSE_IMPORT_DECL 903 #ifdef WIIUSE_COMPILE_LIB 904 #define WIIUSE_EXPORT WIIUSE_EXPORT_DECL 906 #define WIIUSE_EXPORT WIIUSE_IMPORT_DECL 919 #define WIIUSE_HAS_OUTPUT_REDIRECTION int x
calculated X coordinate
Definition: wiiuse.h:497
WIIUSE_EXPORT void wiiuse_status(struct wiimote_t *wm)
Request the wiimote controller status.
Definition: wiiuse.c:536
Nunchuk expansion device.
Definition: wiiuse.h:533
WIIUSE_EXPORT int wiiuse_update(struct wiimote_t **wm, int wiimotes, wiiuse_update_cb callback)
Poll Wiimotes, and call the provided callback with information on each Wiimote that had an event...
Definition: events.c:78
uint16_t btns_held
what buttons are being held down
Definition: wiiuse.h:807
Significant data from the previous event.
Definition: wiiuse.h:677
struct wii_board_t wii_board_t
Wii Balance Board "expansion" device.
float x
horizontal position of the joystick (range [-1, 1]
Definition: wiiuse.h:526
float orient_threshold
threshold for orient to generate an event
Definition: wiiuse.h:544
float pitch
pitch, this may be smoothed if enabled
Definition: wiiuse.h:427
uint32_t addr
the offset that the read started at
Definition: wiiuse.h:368
WIIUSE_EXPORT void wiiuse_set_aspect_ratio(struct wiimote_t *wm, enum aspect_t aspect)
Set the aspect ratio of the TV/monitor.
Definition: ir.c:298
struct ir_t ir_t
IR struct.
WIIUSE_EXPORT void wiiuse_set_ir_vres(struct wiimote_t *wm, unsigned int x, unsigned int y)
Set the virtual screen resolution for IR tracking.
Definition: ir.c:233
byte visible
if the IR source is visible
Definition: wiiuse.h:460
Main Wiimote device structure.
Definition: wiiuse.h:751
struct motion_plus_t motion_plus_t
Motion Plus expansion device.
struct data_req_t * data_req
list of data read requests
Definition: wiiuse.h:794
int32_t accel_threshold
threshold for accel to generate an event
Definition: wiiuse.h:811
Accelerometer struct.
Definition: wiiuse.h:445
WIIUSE_EVENT_TYPE
Events that wiiuse can generate from a poll.
Definition: wiiuse.h:715
A single IR source.
Definition: wiiuse.h:458
int type
type of expansion attached
Definition: wiiuse.h:655
WIIUSE_EXPORT void wiiuse_set_leds(struct wiimote_t *wm, int leds)
Set the enabled LEDs.
Definition: wiiuse.c:267
float st_roll
last smoothed roll value
Definition: wiiuse.h:450
wiiuse_read_cb cb
read data callback
Definition: wiiuse.h:365
int16_t btns_held
what buttons are being held down
Definition: wiiuse.h:558
float st_alpha
alpha value for smoothing [0-1]
Definition: wiiuse.h:452
wiiuse_write_cb cb
read data callback
Definition: wiiuse.h:869
Roll/Pitch/Yaw short angles.
Definition: wiiuse.h:381
struct nunchuk_t * nc
pointers to nunchuk & classic in pass-through-mode
Definition: wiiuse.h:597
float roll
roll, this may be smoothed if enabled
Definition: wiiuse.h:426
byte order
increasing order by x-axis value
Definition: wiiuse.h:468
struct expansion_t expansion_t
Generic expansion device plugged into wiimote.
WIIUSE_EXPORT void wiiuse_motion_sensing(struct wiimote_t *wm, int status)
Set if the wiimote should report motion sensing.
Definition: wiiuse.c:300
struct read_req_t * next
next read request in the queue
Definition: wiiuse.h:373
struct nunchuk_t nunchuk_t
Nunchuk expansion device.
byte num_dots
number of dots at this time
Definition: wiiuse.h:484
uint16_t size
the length of the data read
Definition: wiiuse.h:369
int16_t btns
what buttons have just been pressed
Definition: wiiuse.h:573
float distance
pixel distance between first 2 dots
Definition: wiiuse.h:500
WIIUSE_EXPORT void wiiuse_cleanup(struct wiimote_t **wm, int wiimotes)
Clean up wiimote_t array created by wiiuse_init()
Definition: wiiuse.c:73
int accel_threshold
threshold for accel to generate an event
Definition: wiiuse.h:545
struct gforce_t gforce_t
Gravity force struct.
WIIUSE_EXPORT void wiiuse_wiiboard_use_alternate_report(struct wiimote_t *wm, int enabled)
Switch the Balance Board to use report 0x34 instead of 0x32.
Definition: wiiuse.c:908
struct wiimote_callback_data_t wiimote_callback_data_t
Data passed to a callback during wiiuse_update()
Motion Plus expansion device.
Definition: wiiuse.h:585
void(* wiiuse_update_cb)(struct wiimote_callback_data_t *wm)
Callback type.
Definition: wiiuse.h:839
int y
calculated Y coordinate
Definition: wiiuse.h:498
uint16_t btns
what buttons have just been pressed
Definition: wiiuse.h:806
float whammy_bar
whammy bar (range 0-1)
Definition: wiiuse.h:577
uint16_t btns_released
what buttons were just released this
Definition: wiiuse.h:808
float st_pitch
last smoothed roll pitch
Definition: wiiuse.h:451
int16_t ry
raw Y coordinate (0-767)
Definition: wiiuse.h:466
data_req_s state
set to 1 if not using callback and needs to be cleaned up
Definition: wiiuse.h:868
int * flags
options flag (points to wiimote_t.flags)
Definition: wiiuse.h:538
ir_position_t
IR correction types.
Definition: wiiuse.h:256
struct read_req_t * read_req
list of data read requests
Definition: wiiuse.h:796
struct guitar_hero_3_t guitar_hero_3_t
Guitar Hero 3 expansion device.
int state
keeps track of the IR state
Definition: wiiuse.h:492
Unsigned x,y byte vector.
Definition: wiiuse.h:398
int16_t btns_released
what buttons were just released this
Definition: wiiuse.h:559
WIIUSE_EXPORT struct wiimote_t * wiiuse_get_by_id(struct wiimote_t **wm, int wiimotes, int unid)
Find a wiimote_t structure by its unique identifier.
Definition: wiiuse.c:559
struct classic_ctrl_t classic_ctrl_t
Classic controller expansion device.
Classic controller expansion device.
Definition: wiiuse.h:555
Tatacon expansion device.
Definition: wiiuse.h:604
Gravity force struct.
Definition: wiiuse.h:437
WIIUSE_EXPORT void wiiuse_set_timeout(struct wiimote_t **wm, int wiimotes, byte normal_timeout, byte exp_timeout)
Set the normal and expansion handshake timeouts.
Definition: wiiuse.c:944
WIIUSE_EXPORT struct wiimote_t ** wiiuse_init(int wiimotes)
Initialize an array of wiimote structures.
Definition: wiiuse.c:108
wiiuse_loglevel
Loglevels supported by wiiuse.
Definition: wiiuse.h:877
WIIUSE_EXPORT float wiiuse_set_smooth_alpha(struct wiimote_t *wm, float alpha)
Set the wiimote smoothing alpha value.
Definition: wiiuse.c:820
byte * buf
buffer where read data is written
Definition: wiiuse.h:367
byte dirty
set to 1 if not using callback and needs to be cleaned up
Definition: wiiuse.h:371
void(* wiiuse_read_cb)(struct wiimote_t *wm, byte *data, uint16_t len)
Callback that handles a read event.
Definition: wiiuse.h:358
WIIUSE_EXPORT void wiiuse_disconnected(struct wiimote_t *wm)
The wiimote disconnected.
Definition: wiiuse.c:179
struct vec3f_t vec3f_t
Signed x,y,z float struct.
struct orient_t orient_t
Orientation struct.
WIIUSE_WIIMOTE_TYPE
Type of wiimote peripheral.
Definition: wiiuse.h:741
int16_t rx
raw X coordinate (0-1023)
Definition: wiiuse.h:465
struct vec2b_t vec2b_t
Unsigned x,y byte vector.
WIIUSE_EXPORT void wiiuse_set_ir_sensitivity(struct wiimote_t *wm, int level)
Set the IR sensitivity.
Definition: ir.c:330
WIIUSE_EXPORT void wiiuse_rumble(struct wiimote_t *wm, int status)
Enable or disable the rumble.
Definition: wiiuse.c:211
float a_roll
absolute roll, unsmoothed
Definition: wiiuse.h:430
Guitar Hero 3 expansion device.
Definition: wiiuse.h:571
byte acc_mode
Fast/slow rotation mode for roll, pitch and yaw (0 if rotating fast, 1 if slow or still) ...
Definition: wiiuse.h:593
int8_t btns
what buttons have just been pressed
Definition: wiiuse.h:606
Data passed to a callback during wiiuse_update()
Definition: wiiuse.h:821
IR struct.
Definition: wiiuse.h:481
struct ir_dot_t ir_dot_t
A single IR source.
Orientation struct.
Definition: wiiuse.h:424
byte btns_released
what buttons were just released this
Definition: wiiuse.h:542
WIIUSE_EXPORT int wiiuse_find(struct wiimote_t **wm, int max_wiimotes, int timeout)
Find a wiimote or wiimotes.
Definition: io.c:65
struct wiimote_state_t wiimote_state_t
Significant data from the previous event.
int16_t btns_released
what buttons were just released this
Definition: wiiuse.h:575
WIIUSE_EXPORT int wiiuse_read_data(struct wiimote_t *wm, byte *buffer, unsigned int offset, uint16_t len)
Read data from the wiimote (event version).
Definition: wiiuse.c:480
byte ext
is there a device on the pass-through port?
Definition: wiiuse.h:587
WIIUSE_EXPORT void wiiuse_set_nunchuk_orient_threshold(struct wiimote_t *wm, float threshold)
Set the orientation event threshold for the nunchuk.
Definition: nunchuk.c:189
WIIUSE_EXPORT void wiiuse_set_orient_threshold(struct wiimote_t *wm, float threshold)
Set the orientation event threshold.
Definition: wiiuse.c:876
WIIUSE_EXPORT void wiiuse_set_ir_position(struct wiimote_t *wm, enum ir_position_t pos)
Set the XY position for the IR cursor.
Definition: ir.c:249
int unid
user specified id
Definition: wiiuse.h:753
void(* wiiuse_write_cb)(struct wiimote_t *wm, unsigned char *data, unsigned short len)
Callback that handles a write event.
Definition: wiiuse.h:854
unsigned int x
interpolated X coordinate
Definition: wiiuse.h:462
Data read request structure.
Definition: wiiuse.h:363
byte btns_held
what buttons are being held down
Definition: wiiuse.h:541
float battery_level
battery level
Definition: wiiuse.h:786
int ax
absolute X coordinate
Definition: wiiuse.h:494
float mag
magnitude of the joystick (range 0-1)
Definition: wiiuse.h:525
struct tatacon_t tatacon_t
Tatacon expansion device.
Generic expansion device plugged into wiimote.
Definition: wiiuse.h:653
byte leds
currently lit leds
Definition: wiiuse.h:785
int raw_gyro_threshold
threshold for gyroscopes to generate an event
Definition: wiiuse.h:595
WIIUSE_EXPORT void wiiuse_set_motion_plus(struct wiimote_t *wm, int status)
Enable/disable Motion+ expansion.
Definition: motion_plus.c:177
struct vec3b_t vec3b_t
Unsigned x,y,z byte vector.
WIIUSE_EXPORT void wiiuse_disconnect(struct wiimote_t *wm)
Disconnect a wiimote.
Definition: io.c:108
Roll/Pitch/Yaw float angles.
Definition: wiiuse.h:390
WIIUSE_EXPORT void wiiuse_set_wii_board_calib(struct wiimote_t *wm)
Calib wii board.
Definition: wiiboard.c:168
WIIUSE_EXPORT void wiiuse_set_accel_threshold(struct wiimote_t *wm, int threshold)
Set the accelerometer event threshold.
Definition: wiiuse.c:892
float y
vertical position of the joystick (range [-1, 1]
Definition: wiiuse.h:527
int state
various state flags
Definition: wiiuse.h:784
int flags
options flag
Definition: wiiuse.h:788
int16_t btns_held
what buttons are being held down
Definition: wiiuse.h:574
float a_pitch
absolute pitch, unsmoothed
Definition: wiiuse.h:431
Data write request structure.
Definition: wiiuse.h:862
byte size
size of the IR dot (0-15)
Definition: wiiuse.h:470
WIIUSE_EXPORT int wiiuse_set_flags(struct wiimote_t *wm, int enable, int disable)
Set flags for the specified wiimote.
Definition: wiiuse.c:790
Wii Balance Board "expansion" device.
Definition: wiiuse.h:615
float l_shoulder
left shoulder button (range 0-1)
Definition: wiiuse.h:562
Unsigned x,y,z byte vector.
Definition: wiiuse.h:406
WIIUSE_EXPORT void wiiuse_set_output(enum wiiuse_loglevel loglevel, FILE *logtarget)
Specify an alternate FILE stream for a log level.
Definition: wiiuse.c:68
int16_t btns
what buttons have just been pressed
Definition: wiiuse.h:557
WIIUSE_EXPORT void wiiuse_set_bluetooth_stack(struct wiimote_t **wm, int wiimotes, enum win_bt_stack_t type)
Set the bluetooth stack type to use.
Definition: wiiuse.c:849
unsigned int y
interpolated Y coordinate
Definition: wiiuse.h:463
WIIUSE_EXPORT int wiiuse_write_data(struct wiimote_t *wm, unsigned int addr, const byte *data, byte len)
Write data to the wiimote.
Definition: wiiuse.c:590
struct wiimote_t wiimote
Main Wiimote device structure.
WIIUSE_EVENT_TYPE event
type of event that occurred
Definition: wiiuse.h:815
float ang
angle the joystick is being held
Definition: wiiuse.h:524
WIIUSE_EXPORT const char * wiiuse_version()
Returns the version of the library.
Definition: wiiuse.c:52
WIIUSE_EXPORT int wiiuse_poll(struct wiimote_t **wm, int wiimotes)
Poll the wiimotes for any events.
Definition: events.c:76
WIIUSE_EXPORT void wiiuse_set_ir(struct wiimote_t *wm, int status)
Set if the wiimote should track IR targets.
Definition: ir.c:87
WIIUSE_EXPORT void wiiuse_toggle_rumble(struct wiimote_t *wm)
Toggle the state of the rumble.
Definition: wiiuse.c:249
int ay
absolute Y coordinate
Definition: wiiuse.h:495
aspect_t
Screen aspect ratio.
Definition: wiiuse.h:476
Signed x,y,z float struct.
Definition: wiiuse.h:414
FILE * logtarget[]
Output FILE stream for each wiiuse_loglevel.
Definition: wiiuse.c:57
float r_shoulder
right shoulder button (range 0-1)
Definition: wiiuse.h:561
struct accel_t accel_t
Accelerometer struct.
WIIUSE_EXPORT int wiiuse_connect(struct wiimote_t **wm, int wiimotes)
Connect to a wiimote or wiimotes once an address is known.
Definition: io.c:91
win_bt_stack_t
Available bluetooth stacks for Windows.
Definition: wiiuse.h:672
struct joystick_t joystick_t
Joystick calibration structure.
WIIUSE_EXPORT void wiiuse_resync(struct wiimote_t *wm)
Try to resync with the wiimote by starting a new handshake.
Definition: wiiuse.c:923
uint16_t wait
num bytes still needed to finish read
Definition: wiiuse.h:370
Joystick calibration structure.
Definition: wiiuse.h:518
float z
calculated distance
Definition: wiiuse.h:501
byte btns
what buttons have just been pressed
Definition: wiiuse.h:540
byte expansion_state
the state of the expansion handshake
Definition: wiiuse.h:793
WIIUSE_EXPORT void wiiuse_set_nunchuk_accel_threshold(struct wiimote_t *wm, int threshold)
Set the accelerometer event threshold for the nunchuk.
Definition: nunchuk.c:207
float orient_threshold
threshold for orient to generate an event
Definition: wiiuse.h:810