| | 2 | === wiimote_connect === |
| | 3 | ==== Synopsis ==== |
| | 4 | {{{ |
| | 5 | #!c |
| | 6 | wiimote_t *wiimote_connect(bdaddr_t bdaddr, wiimote_mesg_callback_t *mesg_callback, int *id); |
| | 7 | }}} |
| | 8 | |
| | 9 | ==== Description ==== |
| | 10 | Connect to a wiimote. |
| | 11 | |
| | 12 | ==== Parameters ==== |
| | 13 | bdaddr:: |
| | 14 | in: bluetooth device address of the wiimote. Use `*BDADDR_ANY` to connect to the any (one) available wiimote. |
| | 15 | mesg_callback:: |
| | 16 | in: message callback function |
| | 17 | id:: |
| | 18 | out: `NULL`, or pointer to unique id |
| | 19 | |
| | 20 | ==== Return Value ==== |
| | 21 | wiimote handle, or NULL on error |
| | 22 | |
| | 23 | === wiimote_disconnect === |
| | 24 | ==== Synopsis ==== |
| | 25 | {{{ |
| | 26 | #!c |
| | 27 | int wiimote_disconnect(wiimote_t *wiimote); |
| | 28 | }}} |
| | 29 | |
| | 30 | ==== Description ==== |
| | 31 | Disconnect from a wiimote. |
| | 32 | |
| | 33 | ==== Parameters ==== |
| | 34 | wiimote:: |
| | 35 | wiimote handle |
| | 36 | |
| | 37 | ==== Return Value ==== |
| | 38 | zero on success, nonzero on error |
| | 39 | |
| | 40 | === wiimote_command === |
| | 41 | ==== Synopsis ==== |
| | 42 | {{{ |
| | 43 | #!c |
| | 44 | int wiimote_command(wiimote_t *wiimote, enum wiimote_command command, unsigned char flags); |
| | 45 | }}} |
| | 46 | |
| | 47 | ==== Description ==== |
| | 48 | Issue a command to a wiimote. |
| | 49 | |
| | 50 | ==== Parameters ==== |
| | 51 | wiimote:: |
| | 52 | wiimote handle |
| | 53 | command:: |
| | 54 | * WIIMOTE_CMD_STATUS:: |
| | 55 | Request a status message (delivered to the message callback) |
| | 56 | * WIIMOTE_CMD_LED:: |
| | 57 | Set the LED state |
| | 58 | |
| | 59 | {{{ |
| | 60 | #!c |
| | 61 | int wiimote_read(wiimote_t *wiimote, unsigned int flags, unsigned int offset, unsigned int len, unsigned char *data); |
| | 62 | }}} |
| | 63 | |
| | 64 | {{{ |
| | 65 | #!c |
| | 66 | int wiimote_write(wiimote_t *wiimote, unsigned int flags, unsigned int offset, unsigned int len, unsigned char *data); |
| | 67 | }}} |