C# 클래스 WiimoteLib.Wiimote

Implementation of Wiimote
상속: IDisposable
파일 보기 프로젝트 열기: simphax/WiimoteLib 1 사용 예제들

공개 메소드들

메소드 설명
Connect ( ) : void

Connect to the first-found Wiimote

Disconnect ( ) : void

Disconnect from the controller and stop reading data from it

Dispose ( ) : void

Dispose Wiimote

GetStatus ( ) : void

Retrieve the current status of the Wiimote and extensions. Replaces GetBatteryLevel() since it was poorly named.

ReadData ( int address, short size ) : byte[]

Read data or register from Wiimote

SetLEDs ( bool led1, bool led2, bool led3, bool led4 ) : void

Set the LEDs on the Wiimote

SetLEDs ( int leds ) : void

Set the LEDs on the Wiimote

SetReportType ( InputReport type, IRSensitivity irSensitivity, bool continuous ) : void

Set Wiimote reporting mode

SetReportType ( InputReport type, bool continuous ) : void

Set Wiimote reporting mode (if using an IR report type, IR sensitivity is set to WiiLevel3)

SetRumble ( bool on ) : void

Toggle rumble

Wiimote ( ) : System

Default constructor

WriteData ( int address, byte data ) : void

Write a single byte to the Wiimote

WriteData ( int address, byte size, byte buff ) : void

Write a byte array to a specified address

보호된 메소드들

메소드 설명
Dispose ( bool disposing ) : void

Dispose wiimote

비공개 메소드들

메소드 설명
BeginAsyncRead ( ) : void

Start reading asynchronously from the controller

ClearReport ( ) : void

Initialize the report data buffer

DecryptBuffer ( byte buff ) : byte[]

Decrypts data sent from the extension to the Wiimote

DisableIR ( ) : void

Disable the IR sensor

EnableIR ( IRMode mode, IRSensitivity irSensitivity ) : void

Turn on the IR sensor

FindWiimote ( WiimoteFoundDelegate wiimoteFound ) : void
GetBalanceBoardSensorValue ( short sensor, short min, short mid, short max ) : float
GetRumbleBit ( ) : byte

Returns whether rumble is currently enabled.

InitializeExtension ( ) : void

Handles setting up an extension when plugged in

OnReadData ( IAsyncResult ar ) : void

Callback when data is ready to be processed

OpenWiimoteDeviceHandle ( string devicePath ) : void
ParseAccel ( byte buff ) : void

Parse accelerometer data

ParseButtons ( byte buff ) : void

Parses a standard button report into the ButtonState struct

ParseExtension ( byte buff, int offset ) : void

Parse data from an extension controller

ParseIR ( byte buff ) : void

Parse IR data from report

ParseInputReport ( byte buff ) : bool

Parse a report sent by the Wiimote

ParseReadData ( byte buff ) : void

Parse data returned from a read report

ReadWiimoteCalibration ( ) : void

Read calibration information stored on Wiimote

Wiimote ( string devicePath ) : System
WiimoteFound ( string devicePath ) : bool
WriteReport ( ) : void

Write a report to the Wiimote

메소드 상세

Connect() 공개 메소드

Connect to the first-found Wiimote
Wiimote not found in HID device list
public Connect ( ) : void
리턴 void

Disconnect() 공개 메소드

Disconnect from the controller and stop reading data from it
public Disconnect ( ) : void
리턴 void

Dispose() 공개 메소드

Dispose Wiimote
public Dispose ( ) : void
리턴 void

Dispose() 보호된 메소드

Dispose wiimote
protected Dispose ( bool disposing ) : void
disposing bool Disposing?
리턴 void

GetStatus() 공개 메소드

Retrieve the current status of the Wiimote and extensions. Replaces GetBatteryLevel() since it was poorly named.
public GetStatus ( ) : void
리턴 void

ReadData() 공개 메소드

Read data or register from Wiimote
public ReadData ( int address, short size ) : byte[]
address int Address to read
size short Length to read
리턴 byte[]

SetLEDs() 공개 메소드

Set the LEDs on the Wiimote
public SetLEDs ( bool led1, bool led2, bool led3, bool led4 ) : void
led1 bool LED 1
led2 bool LED 2
led3 bool LED 3
led4 bool LED 4
리턴 void

SetLEDs() 공개 메소드

Set the LEDs on the Wiimote
public SetLEDs ( int leds ) : void
leds int The value to be lit up in base2 on the Wiimote
리턴 void

SetReportType() 공개 메소드

Set Wiimote reporting mode
public SetReportType ( InputReport type, IRSensitivity irSensitivity, bool continuous ) : void
type InputReport Report type
irSensitivity IRSensitivity IR sensitivity
continuous bool Continuous data
리턴 void

SetReportType() 공개 메소드

Set Wiimote reporting mode (if using an IR report type, IR sensitivity is set to WiiLevel3)
public SetReportType ( InputReport type, bool continuous ) : void
type InputReport Report type
continuous bool Continuous data
리턴 void

SetRumble() 공개 메소드

Toggle rumble
public SetRumble ( bool on ) : void
on bool On or off
리턴 void

Wiimote() 공개 메소드

Default constructor
public Wiimote ( ) : System
리턴 System

WriteData() 공개 메소드

Write a single byte to the Wiimote
public WriteData ( int address, byte data ) : void
address int Address to write
data byte Byte to write
리턴 void

WriteData() 공개 메소드

Write a byte array to a specified address
public WriteData ( int address, byte size, byte buff ) : void
address int Address to write
size byte Length of buffer
buff byte Data buffer
리턴 void