wiiusej.wiiuseapievents
Class StatusEvent

java.lang.Object
  extended by wiiusej.wiiuseapievents.WiimoteEvent
      extended by wiiusej.wiiuseapievents.WiiUseApiEvent
          extended by wiiusej.wiiuseapievents.StatusEvent

public class StatusEvent
extends WiiUseApiEvent

Class used to represent a status event. This class is used to know what are the settings of the wiimote.

Author:
guiguito

Field Summary
private  int attachment
           
private  float batteryLevel
           
private  boolean connected
           
private static short EXP_CLASSIC
           
private static short EXP_GUITAR_HERO_3
           
private static short EXP_NONE
           
private static short EXP_NUNCHUK
           
private  boolean isContinuousActive
           
private  boolean isIrActive
           
private  boolean isMotionSensingActive
           
private  boolean isRumbleActive
           
private  boolean isSpeakerEnabled
           
private  short leds
           
private static short WIIMOTE_LED_1
           
private static short WIIMOTE_LED_2
           
private static short WIIMOTE_LED_3
           
private static short WIIMOTE_LED_4
           
 
Fields inherited from class wiiusej.wiiuseapievents.WiiUseApiEvent
DISCONNECTION_EVENT, GENERIC_EVENT, STATUS_EVENT, WIIUSE_CLASSIC_CTRL_INSERTED, WIIUSE_CLASSIC_CTRL_REMOVED, WIIUSE_GUITAR_HERO_3_CTRL_INSERTED, WIIUSE_GUITAR_HERO_3_CTRL_REMOVED, WIIUSE_NUNCHUK_INSERTED, WIIUSE_NUNCHUK_REMOVED
 
Constructor Summary
StatusEvent(int id)
          Construct the StatusEvent setting up the id.
StatusEvent(int id, boolean connect, float batt, short led, boolean speak, int attach, boolean rumbleState, boolean continuousState, boolean irState, boolean motionSensingState)
          Build a StatusEvent with all fields set.
 
Method Summary
 int getAttachment()
          Get the int representing the attachment type.
 float getBatteryLevel()
          Get battery level.
 short getLeds()
          Get status of the leds .
 boolean isConnected()
          True if the wiimote is connected false otherwise.
 boolean isContinuousActive()
          Tell if the CONTINUOUS option is activated.
 boolean isIrActive()
          Tell if the IR Tracking is active.
 boolean isLed1Set()
          Get led1 status.
 boolean isLed2Set()
          Get led2 status.
 boolean isLed3Set()
          Get led3 status.
 boolean isLed4Set()
          Get led4 status.
 boolean isMotionSensingActive()
          Get the flag indicating if the motion sensing is active.
 boolean isRumbleActive()
          Get the status of rumble.
 boolean isSpeakerEnabled()
          Tell if the speaker is enable for this wiimote
 java.lang.String toString()
           
 
Methods inherited from class wiiusej.wiiuseapievents.WiiUseApiEvent
getEventType
 
Methods inherited from class wiiusej.wiiuseapievents.WiimoteEvent
getWiimoteId, setWiimoteId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

WIIMOTE_LED_1

private static short WIIMOTE_LED_1

WIIMOTE_LED_2

private static short WIIMOTE_LED_2

WIIMOTE_LED_3

private static short WIIMOTE_LED_3

WIIMOTE_LED_4

private static short WIIMOTE_LED_4

EXP_NONE

private static short EXP_NONE

EXP_NUNCHUK

private static short EXP_NUNCHUK

EXP_CLASSIC

private static short EXP_CLASSIC

EXP_GUITAR_HERO_3

private static short EXP_GUITAR_HERO_3

connected

private boolean connected

batteryLevel

private float batteryLevel

leds

private short leds

isSpeakerEnabled

private boolean isSpeakerEnabled

attachment

private int attachment

isRumbleActive

private boolean isRumbleActive

isContinuousActive

private boolean isContinuousActive

isIrActive

private boolean isIrActive

isMotionSensingActive

private boolean isMotionSensingActive
Constructor Detail

StatusEvent

public StatusEvent(int id)
Construct the StatusEvent setting up the id.

Parameters:
id - the Wiimote id

StatusEvent

public StatusEvent(int id,
                   boolean connect,
                   float batt,
                   short led,
                   boolean speak,
                   int attach,
                   boolean rumbleState,
                   boolean continuousState,
                   boolean irState,
                   boolean motionSensingState)
Build a StatusEvent with all fields set.

Parameters:
id - id of the wiimote
connect - true if the wiimote is connected
batt - battery level
led - status of leds
speak - speakers status
attach - attachment status
rumbleState - true if rumble is active
continuousState - true if continuous flag is activated
irState - true if ir is active
motionSensingState - true if accelerometer is active
Method Detail

isConnected

public boolean isConnected()
True if the wiimote is connected false otherwise.

Returns:
return the connected status.

getBatteryLevel

public float getBatteryLevel()
Get battery level.

Returns:
battery level. 1 = 100%

getLeds

public short getLeds()
Get status of the leds .

Returns:
a short representing LEDS turned on.

isLed1Set

public boolean isLed1Set()
Get led1 status.

Returns:
true if the led is set.

isLed2Set

public boolean isLed2Set()
Get led2 status.

Returns:
true if the led is set.

isLed3Set

public boolean isLed3Set()
Get led3 status.

Returns:
true if the led is set.

isLed4Set

public boolean isLed4Set()
Get led4 status.

Returns:
true if the led is set.

isSpeakerEnabled

public boolean isSpeakerEnabled()
Tell if the speaker is enable for this wiimote

Returns:
TRUE if it enabled false otherwise

getAttachment

public int getAttachment()
Get the int representing the attachment type.

Returns:
value of the Attachment Type

isRumbleActive

public boolean isRumbleActive()
Get the status of rumble.

Returns:
true if the rumble is active false otherwise

isContinuousActive

public boolean isContinuousActive()
Tell if the CONTINUOUS option is activated.

Returns:
the isContinuousActive

isIrActive

public boolean isIrActive()
Tell if the IR Tracking is active.

Returns:
TRUE if it is active or false otherwise.

isMotionSensingActive

public boolean isMotionSensingActive()
Get the flag indicating if the motion sensing is active.

Returns:
true if the motion sensing is active false otherwise

toString

public java.lang.String toString()
Specified by:
toString in class WiiUseApiEvent