#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_BUTTONS |
#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_MASK_LEDS |
#define | WRMT_SPEAKER_SAMPLE_RATE_4200 0x0B |
speaker sample rate id 11 (0x0B) = 4200 Hz 12 (0x0C) = 3920 Hz 13 (0x0D) = 3640 Hz 14 (0x0E) = 3360 Hz 15 (0x0F) = 3080 Hz | |
#define | WRMT_SPEAKER_SAMPLE_RATE_3920 0x0C |
#define | WRMT_SPEAKER_SAMPLE_RATE_3640 0x0D |
#define | WRMT_SPEAKER_SAMPLE_RATE_3360 0x0E |
#define | WRMT_SPEAKER_SAMPLE_RATE_3080 0x0F |
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_DATA_BATTERY_LEVEL, WRMT_NUMBER_OF_DATA_TYPE } |
Data Type ID. More... | |
enum | WRMT_IOReturn { WRMT_IO_TIMEOUT = -2, WRMT_IO_ERROR = -1, WRMT_IO_SUCCESS = 0 } |
Functions | |
WRMT_DECLSPEC void | WRMT_SetError (const char *message) |
Set Error. | |
WRMT_DECLSPEC char * | WRMT_GetError () |
Get Error. | |
WRMT_DECLSPEC int | WRMT_Init () |
Initialize this library system. | |
WRMT_DECLSPEC void | WRMT_Quit () |
Quit library system. | |
WRMT_DECLSPEC void | WRMT_Sleep (int ms) |
Sleep. | |
WRMT_DECLSPEC int | WRMT_UpdateAll () |
Update all opened Wii Remote devices. | |
WRMT_DECLSPEC int | WRMT_Poll () |
Checks whether there is input data from the Wii Remote device. | |
WRMT_DECLSPEC int | WRMT_GetNumWiiRemote () |
Get the number of Wii Remote devices. | |
WRMT_DECLSPEC WRMT_WiiRemote * | WRMT_GetWiiRemoteAt (int device_index) |
Get the Wii Remote device at specified index. | |
WRMT_DECLSPEC WRMT_IOReturn | WRMT_WiiRemote_Open (WRMT_WiiRemote *self) |
Open connection to Wii Remote. | |
WRMT_DECLSPEC int | WRMT_WiiRemote_IsOpened (WRMT_WiiRemote *self) |
Checks whether the connection to Wii Remote has opened. | |
WRMT_DECLSPEC void | WRMT_WiiRemote_Close (WRMT_WiiRemote *self) |
Close connection to Wii Remote. | |
WRMT_DECLSPEC int | WRMT_WiiRemote_IsEnabled (WRMT_WiiRemote *self, WRMT_FunctionType function_type) |
Checks whether the specified function is enabled. | |
WRMT_DECLSPEC void | WRMT_WiiRemote_SetEnabled (WRMT_WiiRemote *self, WRMT_FunctionType function_type, int value) |
Enable or disable the specified function. | |
WRMT_DECLSPEC int | WRMT_WiiRemote_GetState (WRMT_WiiRemote *self, WRMT_DataType data_type) |
Get device state from Wii Remote. | |
WRMT_DECLSPEC void | WRMT_WiiRemote_SetState (WRMT_WiiRemote *self, WRMT_DataType data_type, int value) |
Sets the state of the Wii Remote device. | |
WRMT_DECLSPEC WRMT_IOReturn | WRMT_WiiRemote_Update (WRMT_WiiRemote *self) |
Update the state of the Wii Remote device. | |
WRMT_DECLSPEC WRMT_IOReturn | WRMT_WiiRemote_WriteDataToMemory (WRMT_WiiRemote *self, int address, const unsigned char *data, size_t data_size) |
Writes data to the specified memory area. | |
WRMT_DECLSPEC WRMT_IOReturn | WRMT_WiiRemote_PlaySound (WRMT_WiiRemote *self, const unsigned char *sound_data, size_t sound_data_size) |
Play sound. |
#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_BUTTONS |
#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_MASK_LEDS |
Value:
#define WRMT_MAX_DEVICES 32 |
#define WRMT_SPEAKER_SAMPLE_RATE_3080 0x0F |
#define WRMT_SPEAKER_SAMPLE_RATE_3360 0x0E |
#define WRMT_SPEAKER_SAMPLE_RATE_3640 0x0D |
#define WRMT_SPEAKER_SAMPLE_RATE_3920 0x0C |
#define WRMT_SPEAKER_SAMPLE_RATE_4200 0x0B |
speaker sample rate id 11 (0x0B) = 4200 Hz 12 (0x0C) = 3920 Hz 13 (0x0D) = 3640 Hz 14 (0x0E) = 3360 Hz 15 (0x0F) = 3080 Hz
typedef struct wrmt_wiiremote WRMT_WiiRemote |
enum WRMT_DataType |
Data Type ID.
enum WRMT_FunctionType |
Function Type ID.
enum WRMT_IOReturn |
WRMT_DECLSPEC char* WRMT_GetError | ( | ) |
Get Error.
WRMT_DECLSPEC int WRMT_GetNumWiiRemote | ( | ) |
Get the number of Wii Remote devices.
WRMT_DECLSPEC WRMT_WiiRemote* WRMT_GetWiiRemoteAt | ( | int | device_index | ) |
Get the Wii Remote device at specified index.
If an illegal value is passed to device_index
, the result is undefined.
device_index | the index of device. a valid range is 0 to WRMT_GetNumWiiRemote()-1. |
WRMT_DECLSPEC int WRMT_Init | ( | ) |
Initialize this library system.
It is necessary to call this function before the call of any other functions.
WRMT_DECLSPEC int WRMT_Poll | ( | ) |
Checks whether there is input data from the Wii Remote device.
The state is updated if there is data.
WRMT_DECLSPEC void WRMT_Quit | ( | ) |
Quit library system.
You should call this function before stop the program.
WRMT_DECLSPEC void WRMT_SetError | ( | const char * | message | ) |
Set Error.
WRMT_DECLSPEC void WRMT_Sleep | ( | int | ms | ) |
Sleep.
Pause for ms
milliseconds.
ms | the sleeping time specified by the millisecond. |
WRMT_DECLSPEC int WRMT_UpdateAll | ( | ) |
Update all opened Wii Remote devices.
WRMT_DECLSPEC void WRMT_WiiRemote_Close | ( | WRMT_WiiRemote * | self | ) |
Close connection to Wii Remote.
self | the reference of WRMT_WiiRemote. |
WRMT_DECLSPEC int WRMT_WiiRemote_GetState | ( | WRMT_WiiRemote * | self, | |
WRMT_DataType | data_type | |||
) |
Get device state from Wii Remote.
If an illegal value is passed to data_type
, the result is undefined.
self | the reference of WRMT_WiiRemote. | |
data_type | the type of data. |
data_type
. WRMT_DECLSPEC int WRMT_WiiRemote_IsEnabled | ( | WRMT_WiiRemote * | self, | |
WRMT_FunctionType | function_type | |||
) |
Checks whether the specified function is enabled.
If an illegal value is passed to function_type
, the result is undefined.
self | the reference of WRMT_WiiRemote. | |
function_type | the type of function. |
WRMT_DECLSPEC int WRMT_WiiRemote_IsOpened | ( | WRMT_WiiRemote * | self | ) |
Checks whether the connection to Wii Remote has opened.
self | the reference of WRMT_WiiRemote. |
WRMT_DECLSPEC WRMT_IOReturn WRMT_WiiRemote_Open | ( | WRMT_WiiRemote * | self | ) |
Open connection to Wii Remote.
self | the reference of WRMT_WiiRemote. |
WRMT_DECLSPEC WRMT_IOReturn WRMT_WiiRemote_PlaySound | ( | WRMT_WiiRemote * | self, | |
const unsigned char * | sound_data, | |||
size_t | sound_data_size | |||
) |
Play sound.
self | the reference of WRMT_WiiRemote. | |
sound_data | the pointer of sound data. | |
sound_data_size | the size of sound data. |
WRMT_DECLSPEC void WRMT_WiiRemote_SetEnabled | ( | WRMT_WiiRemote * | self, | |
WRMT_FunctionType | function_type, | |||
int | value | |||
) |
Enable or disable the specified function.
When WRMT_WiiRemote_Update() is called, the function is actually enabled. If an illegal value is passed to function_type
, the result is undefined.
self | the reference of WRMT_WiiRemote. | |
function_type | the type of function. | |
value | enable : 1, disable : 0 |
WRMT_DECLSPEC void WRMT_WiiRemote_SetState | ( | WRMT_WiiRemote * | self, | |
WRMT_DataType | data_type, | |||
int | value | |||
) |
Sets the state of the Wii Remote device.
When WRMT_WiiRemote_Update() is called, the value is actually transmitted. If an illegal value is passed to data_type
, the result is undefined.
self | the reference of WRMT_WiiRemote. | |
data_type | the type of data. | |
value | the various values by the data_type . |
WRMT_DECLSPEC WRMT_IOReturn WRMT_WiiRemote_Update | ( | WRMT_WiiRemote * | self | ) |
Update the state of the Wii Remote device.
self | the reference of WRMT_WiiRemote. |
WRMT_DECLSPEC WRMT_IOReturn WRMT_WiiRemote_WriteDataToMemory | ( | WRMT_WiiRemote * | self, | |
int | address, | |||
const unsigned char * | data, | |||
size_t | data_size | |||
) |
Writes data to the specified memory area.
self | the reference of WRMT_WiiRemote. | |
address | ||
data | ||
data_size |