Changes between Version 3 and Version 4 of libwiimote
- Timestamp:
- 02/28/07 18:06:57 (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
libwiimote
v3 v4 6 6 wiimote_t *wiimote_connect(bdaddr_t bdaddr, wiimote_mesg_callback_t *mesg_callback, int *id); 7 7 }}} 8 ==== Parameters ==== 9 bdaddr:: in: bluetooth device address of the wiimote. Use `*BDADDR_ANY` to connect to the any (one) available wiimote. 10 mesg_callback:: in: message callback function 11 id:: out: `NULL`, or pointer to unique id 8 12 ==== Description ==== 9 13 Connect to a wiimote. 10 ==== Parameters ====11 bdaddr::12 in: bluetooth device address of the wiimote. Use `*BDADDR_ANY` to connect to the any (one) available wiimote.13 mesg_callback::14 in: message callback function15 id::16 out: `NULL`, or pointer to unique id17 14 ==== Return Value ==== 18 wiimote handle, or NULLon error15 wiimote handle, or `NULL` on error 19 16 ---- 20 17 … … 25 22 int wiimote_disconnect(wiimote_t *wiimote); 26 23 }}} 24 ==== Parameters ==== 25 wiimote:: wiimote handle 27 26 ==== Description ==== 28 Disconnect from a wiimote. 29 ==== Parameters ==== 30 wiimote:: 31 wiimote handle 27 Disconnect from `wiimote`. 32 28 ==== Return Value ==== 33 zero on success ,nonzero on error29 zero on success or nonzero on error 34 30 ---- 35 31 … … 40 36 int wiimote_command(wiimote_t *wiimote, enum wiimote_command command, unsigned char flags); 41 37 }}} 38 ==== Parameters ==== 39 wiimote:: wiimote handle 40 command:: wiimote command 41 flags:: command-specific flags 42 42 ==== Description ==== 43 Issue a command to a wiimote. 44 ==== Parameters ==== 45 wiimote:: 46 wiimote handle 47 command:: 48 * WIIMOTE_CMD_STATUS:: 49 Request a status message (delivered to the message callback) 50 * WIIMOTE_CMD_LED:: 51 Set the LED state 43 Issue command to wiimote. 44 ===== Commands and associated flags ===== 45 `WIIMOTE_CMD_STATUS`:: Request a status message (delivered to the message callback) (flags ignored) 46 `WIIMOTE_CMD_LED`:: Set the LED state. The following flags may be bitwise ORed: 47 * `WIIMOTE_LED1_ON` 48 * `WIIMOTE_LED2_ON` 49 * `WIIMOTE_LED3_ON` 50 * `WIIMOTE_LED4_ON` 51 `WIIMOTE_CMD_RUMBLE`:: Set the Rumble state. Set flags to 0 for off, anything else for on. 52 `WIIMOTE_CMD_RPT_MODE`:: Set the reporting mode of the wiimote, which determines which messages are delivered to the message callback. 53 The following flags may be bitwise ORed (Note that it may not be assumed that each flag is a single bit - specifically, `WIIMOTE_RPT_EXT = WIIMOTE_RPT_NUNCHUK | WIIMOTE_RPT_CLASSIC`): 54 * `WIIMOTE_RPT_STATUS` 55 * `WIIMOTE_RPT_BTN` 56 * `WIIMOTE_RPT_ACC` 57 * `WIIMOTE_RPT_IR` 58 * `WIIMOTE_RPT_NUNCHUK` 59 * `WIIMOTE_RPT_CLASSIC` 60 * `WIIMOTE_RPT_EXT` 61 ` 62 ==== Return Value ==== 63 zero on success or nonzero on error 52 64 ---- 53 65 66 === wiimote_read === 67 ==== Synopsis ==== 54 68 {{{ 55 69 #!c 56 70 int wiimote_read(wiimote_t *wiimote, unsigned int flags, unsigned int offset, unsigned int len, unsigned char *data); 57 71 }}} 72 ==== Parameters ==== 73 wiimote:: wiimote handle 74 command:: wiimote command 75 flags:: command-specific flags 58 76 77 ---- 59 78 {{{ 60 79 #!c
