wiiremote.h File Reference

#include <stdlib.h>

Include dependency graph for wiiremote.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define WRMT_MAX_DEVICES   32
#define WRMT_MASK_BUTTON_TWO   0x0001
#define WRMT_MASK_BUTTON_ONE   0x0002
#define WRMT_MASK_BUTTON_B   0x0004
#define WRMT_MASK_BUTTON_A   0x0008
#define WRMT_MASK_BUTTON_MINUS   0x0010
#define WRMT_MASK_BUTTON_HOME   0x0080
#define WRMT_MASK_BUTTON_LEFT   0x0100
#define WRMT_MASK_BUTTON_RIGHT   0x0200
#define WRMT_MASK_BUTTON_DOWN   0x0400
#define WRMT_MASK_BUTTON_UP   0x0800
#define WRMT_MASK_BUTTON_PLUS   0x1000
#define WRMT_MASK_LED_1   0x0001
#define WRMT_MASK_LED_2   0x0002
#define WRMT_MASK_LED_3   0x0004
#define WRMT_MASK_LED_4   0x0008

Typedefs

typedef wrmt_wiiremote WRMT_WiiRemote

Enumerations

enum  WRMT_FunctionType {
  WRMT_FUNCTION_CONTINUOUS = 0, WRMT_FUNCTION_MOTION, WRMT_FUNCTION_IR, WRMT_FUNCTION_SPEAKER,
  WRMT_NUMBER_OF_FUNCTIONS
}
 Function Type ID. More...
enum  WRMT_DataType {
  WRMT_DATA_FORCE_FEEDBACK = 0, WRMT_DATA_LEDS, WRMT_DATA_SPEAKER_FORMAT, WRMT_DATA_SPEAKER_VOLUME,
  WRMT_DATA_SPEAKER_SAMPLE_RATE, WRMT_DATA_BUTTONS, WRMT_DATA_MOTION_X, WRMT_DATA_MOTION_Y,
  WRMT_DATA_MOTION_Z, WRMT_DATA_IR1_FOUND, WRMT_DATA_IR1_SIZE, WRMT_DATA_IR1_X,
  WRMT_DATA_IR1_Y, WRMT_DATA_IR2_FOUND, WRMT_DATA_IR2_SIZE, WRMT_DATA_IR2_X,
  WRMT_DATA_IR2_Y, WRMT_DATA_IR_FOUND, WRMT_DATA_IR_SIZE, WRMT_DATA_IR_X,
  WRMT_DATA_IR_Y, WRMT_NUMBER_OF_DATA_TYPE
}
 Data Type ID. More...
enum  WRMT_IOReturn { WRMT_IO_ERROR = -1, WRMT_IO_SUCCESS = 0, WRMT_IO_TIMEOUT = 1 }

Functions

void WRMT_SetError (const char *message)
 Set Error.
char * WRMT_GetError ()
 Get Error.
int WRMT_Init ()
 Initialize this library system.
void WRMT_Quit ()
 Quit library system.
void WRMT_Sleep (int ms)
 Sleep.
void WRMT_Update ()
 Update all opened Wii Remote devices.
WRMT_IOReturn WRMT_Poll (int *updated_device_index_pointer)
 Checks whether there is input data from the Wii Remote device.
int WRMT_GetNumWiiRemote ()
 Get number of Wii Remote devices.
WRMT_WiiRemoteWRMT_GetWiiRemoteAt (int device_index)
 Get Wii Remote device at specified index.
WRMT_IOReturn WRMT_WiiRemote_Open (WRMT_WiiRemote *self)
 Open connection to Wii Remote.
int WRMT_WiiRemote_IsOpened (WRMT_WiiRemote *self)
 Checks whether the connection to Wii Remote has opened.
void WRMT_WiiRemote_Close (WRMT_WiiRemote *self)
 Close connection to Wii Remote.
int WRMT_WiiRemote_IsEnabled (WRMT_WiiRemote *self, WRMT_FunctionType type)
 Checks whether the specified function is enabled.
void WRMT_WiiRemote_SetEnabled (WRMT_WiiRemote *self, WRMT_FunctionType type, int value)
 Enable or disable the specified function.
int WRMT_WiiRemote_GetState (WRMT_WiiRemote *self, WRMT_DataType type)
 Get device state from WiiRemote.
void WRMT_WiiRemote_SetState (WRMT_WiiRemote *self, WRMT_DataType type, int value)
 Sets the state of the Wii Remote device.
int WRMT_WiiRemote_WriteDataToMemory (WRMT_WiiRemote *self, int address, const unsigned char *data, size_t data_size)
 Writes data to the specified memory area.


Define Documentation

#define WRMT_MASK_BUTTON_A   0x0008

#define WRMT_MASK_BUTTON_B   0x0004

#define WRMT_MASK_BUTTON_DOWN   0x0400

#define WRMT_MASK_BUTTON_HOME   0x0080

#define WRMT_MASK_BUTTON_LEFT   0x0100

#define WRMT_MASK_BUTTON_MINUS   0x0010

#define WRMT_MASK_BUTTON_ONE   0x0002

#define WRMT_MASK_BUTTON_PLUS   0x1000

#define WRMT_MASK_BUTTON_RIGHT   0x0200

#define WRMT_MASK_BUTTON_TWO   0x0001

#define WRMT_MASK_BUTTON_UP   0x0800

#define WRMT_MASK_LED_1   0x0001

#define WRMT_MASK_LED_2   0x0002

#define WRMT_MASK_LED_3   0x0004

#define WRMT_MASK_LED_4   0x0008

#define WRMT_MAX_DEVICES   32


Typedef Documentation

typedef struct wrmt_wiiremote WRMT_WiiRemote


Enumeration Type Documentation

enum WRMT_DataType

Data Type ID.

See also:
WRMT_WiiRemote_GetState(), WRMT_WiiRemote_SetState()
Enumerator:
WRMT_DATA_FORCE_FEEDBACK 
WRMT_DATA_LEDS 
WRMT_DATA_SPEAKER_FORMAT 
WRMT_DATA_SPEAKER_VOLUME 
WRMT_DATA_SPEAKER_SAMPLE_RATE 
WRMT_DATA_BUTTONS 
WRMT_DATA_MOTION_X 
WRMT_DATA_MOTION_Y 
WRMT_DATA_MOTION_Z 
WRMT_DATA_IR1_FOUND 
WRMT_DATA_IR1_SIZE 
WRMT_DATA_IR1_X 
WRMT_DATA_IR1_Y 
WRMT_DATA_IR2_FOUND 
WRMT_DATA_IR2_SIZE 
WRMT_DATA_IR2_X 
WRMT_DATA_IR2_Y 
WRMT_DATA_IR_FOUND 
WRMT_DATA_IR_SIZE 
WRMT_DATA_IR_X 
WRMT_DATA_IR_Y 
WRMT_NUMBER_OF_DATA_TYPE 

enum WRMT_FunctionType

Function Type ID.

See also:
WRMT_WiiRemote_IsEnabled(), WRMT_WiiRemote_SetEnabled()
Enumerator:
WRMT_FUNCTION_CONTINUOUS 
WRMT_FUNCTION_MOTION 
WRMT_FUNCTION_IR 
WRMT_FUNCTION_SPEAKER 
WRMT_NUMBER_OF_FUNCTIONS 

enum WRMT_IOReturn

Enumerator:
WRMT_IO_ERROR 
WRMT_IO_SUCCESS 
WRMT_IO_TIMEOUT 


Function Documentation

char* WRMT_GetError (  ) 

Get Error.

int WRMT_GetNumWiiRemote (  ) 

Get number of Wii Remote devices.

WRMT_WiiRemote* WRMT_GetWiiRemoteAt ( int  device_index  ) 

Get Wii Remote device at specified index.

int WRMT_Init (  ) 

Initialize this library system.

It is necessary to call this function before the call of any other functions.

WRMT_IOReturn WRMT_Poll ( int *  updated_device_index_pointer  ) 

Checks whether there is input data from the Wii Remote device.

The state is updated if there is data.

void WRMT_Quit (  ) 

Quit library system.

void WRMT_SetError ( const char *  message  ) 

Set Error.

void WRMT_Sleep ( int  ms  ) 

Sleep.

void WRMT_Update (  ) 

Update all opened Wii Remote devices.

void WRMT_WiiRemote_Close ( WRMT_WiiRemote self  ) 

Close connection to Wii Remote.

int WRMT_WiiRemote_GetState ( WRMT_WiiRemote self,
WRMT_DataType  type 
)

Get device state from WiiRemote.

int WRMT_WiiRemote_IsEnabled ( WRMT_WiiRemote self,
WRMT_FunctionType  type 
)

Checks whether the specified function is enabled.

int WRMT_WiiRemote_IsOpened ( WRMT_WiiRemote self  ) 

Checks whether the connection to Wii Remote has opened.

WRMT_IOReturn WRMT_WiiRemote_Open ( WRMT_WiiRemote self  ) 

Open connection to Wii Remote.

void WRMT_WiiRemote_SetEnabled ( WRMT_WiiRemote self,
WRMT_FunctionType  type,
int  value 
)

Enable or disable the specified function.

void WRMT_WiiRemote_SetState ( WRMT_WiiRemote self,
WRMT_DataType  type,
int  value 
)

Sets the state of the Wii Remote device.

int WRMT_WiiRemote_WriteDataToMemory ( WRMT_WiiRemote self,
int  address,
const unsigned char *  data,
size_t  data_size 
)

Writes data to the specified memory area.


Generated on Thu Dec 20 19:06:39 2007 for libwiiremote by  doxygen 1.5.1