xbmc
Functions
io_nix.c File Reference

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"
Include dependency graph for io_nix.c:

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)
 

Detailed Description

Handles device I/O for *nix.

Function Documentation

◆ wiiuse_connect()

int wiiuse_connect ( struct wiimote_t **  wm,
int  wiimotes 
)

Connect to a wiimote or wiimotes once an address is known.

Parameters
wmAn array of wiimote_t structures.
wiimotesThe number of wiimote structures in wm.
Returns
The number of wiimotes that successfully connected.
See also
wiiuse_find()
wiiuse_connect_single()
wiiuse_disconnect()

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.

◆ wiiuse_disconnect()

void wiiuse_disconnect ( struct wiimote_t wm)

Disconnect a wiimote.

Parameters
wmPointer to a wiimote_t structure.
See also
wiiuse_connect()

Note that this will not free the wiimote structure.

◆ wiiuse_find()

int wiiuse_find ( struct wiimote_t **  wm,
int  max_wiimotes,
int  timeout 
)

Find a wiimote or wiimotes.

Parameters
wmAn array of wiimote_t structures.
max_wiimotesThe number of wiimote structures in wm.
timeoutThe number of seconds before the search times out.
Returns
The number of wiimotes found.
See also
wiimote_connect()

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.