wiiremotej.event
Class WRStatusReportedEvent

java.lang.Object
  extended by java.util.EventObject
      extended by wiiremotej.event.WREvent
          extended by wiiremotej.event.WRStatusReportedEvent
All Implemented Interfaces:
java.io.Serializable

public class WRStatusReportedEvent
extends WREvent

Status reported event for Nintendo (R) Wii Remote (TM). Contains data from a status report.

See Also:
Serialized Form

Field Summary
static int MAX_BATTERY_LEVEL
          The maximum battery level.
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
WRStatusReportedEvent(WiiRemote source, byte[] data)
          Creates a new WRStatusReportedEvent from the given input data array.
 
Method Summary
 int getBatteryLevel()
          Returns the battery level of the remote.
 boolean[] getLEDStatus()
          Returns the status of the LED lights.
 boolean getLEDStatus(int light)
          Returns the status of the the specified light.
 boolean isContinuousEnabled()
          Returns the status of continuous reporting.
 boolean isExtensionConnected()
          Returns the status of the extension port.
 boolean isSpeakerEnabled()
          Returns the status of the speaker.
 
Methods inherited from class wiiremotej.event.WREvent
getSource
 
Methods inherited from class java.util.EventObject
toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MAX_BATTERY_LEVEL

public static final int MAX_BATTERY_LEVEL
The maximum battery level.

See Also:
Constant Field Values
Constructor Detail

WRStatusReportedEvent

public WRStatusReportedEvent(WiiRemote source,
                             byte[] data)
Creates a new WRStatusReportedEvent from the given input data array. This array contains ALL of the bits directly from input.

Parameters:
source - the WiiRemote triggering this event.
data - the byte data to process for status information.
Method Detail

isExtensionConnected

public boolean isExtensionConnected()
Returns the status of the extension port.

Returns:
true if an extension is connected; otherwise false.

isSpeakerEnabled

public boolean isSpeakerEnabled()
Returns the status of the speaker.

Returns:
true if the speaker is enabled; otherwise false.

isContinuousEnabled

public boolean isContinuousEnabled()
Returns the status of continuous reporting.

Returns:
true if continuous reporting is enabled; otherwise false.

getLEDStatus

public boolean[] getLEDStatus()
Returns the status of the LED lights.

Returns:
status of the LED lights. In the array, true indicates the light is on and false indicates it is off.

getLEDStatus

public boolean getLEDStatus(int light)
                     throws java.lang.IllegalArgumentException
Returns the status of the the specified light.

Parameters:
light - the light to check the status of. 0 is the first light, 1 the second, etc.
Returns:
true if light is on; otherwise false.
Throws:
IllegalArgument - Exception if light is not one of 0, 1, 2, or 3.
java.lang.IllegalArgumentException

getBatteryLevel

public int getBatteryLevel()
Returns the battery level of the remote. See MAX_BATTERY_LEVEL to understand what this value means.

Returns:
the battery level of the remote.