xbmc
|
Handles device I/O for *nix. More...
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <bluetooth/bluetooth.h>
#include <bluetooth/hci.h>
#include <bluetooth/hci_lib.h>
#include <bluetooth/l2cap.h>
#include "definitions.h"
#include "wiiuse_internal.h"
#include "io.h"
Functions | |
int | wiiuse_find (struct wiimote_t **wm, int max_wiimotes, int timeout) |
Find a wiimote or wiimotes. More... | |
int | wiiuse_connect (struct wiimote_t **wm, int wiimotes) |
Connect to a wiimote or wiimotes once an address is known. More... | |
void | wiiuse_disconnect (struct wiimote_t *wm) |
Disconnect a wiimote. More... | |
int | wiiuse_io_read (struct wiimote_t *wm) |
int | wiiuse_io_write (struct wiimote_t *wm, byte *buf, int len) |
Handles device I/O for *nix.
int wiiuse_connect | ( | struct wiimote_t ** | wm, |
int | wiimotes | ||
) |
Connect to a wiimote or wiimotes once an address is known.
wm | An array of wiimote_t structures. |
wiimotes | The number of wiimote structures in wm. |
Connect to a number of wiimotes when the address is already set in the wiimote_t structures. These addresses are normally set by the wiiuse_find() function, but can also be set manually.
void wiiuse_disconnect | ( | struct wiimote_t * | wm | ) |
int wiiuse_find | ( | struct wiimote_t ** | wm, |
int | max_wiimotes, | ||
int | timeout | ||
) |
Find a wiimote or wiimotes.
wm | An array of wiimote_t structures. |
max_wiimotes | The number of wiimote structures in wm. |
timeout | The number of seconds before the search times out. |
This function will only look for wiimote devices.
When a device is found the address in the structures will be set.
You can then call wiimote_connect() to connect to the found
devices.