WRNunchuckExtension
Keywords: wiiremotej.WRNunchuckExtension class

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## wiiremotej
Class WRNunchuckExtension

    java.lang.Object
      wiiremotej.WRExtension
          wiiremotej.WRNunchuckExtension

    public class WRNunchuckExtension

extends WRExtension

A class representing a Nintendo (R) Wii Remote (TM) Nunchuck extension. It has information about the extension and can create WRNunchuckExtensionEvents.

Constructor Summary
`WRNunchuckExtension(int payload)` Creates a new WRNunchuckExtension with the given payload.

Method Summary
`WRNunchuckExtensionEvent` | `createWRExtensionEvent(WiiRemote source, byte[] input, int offset)` Creates and returns a new WRNunchuckExtensionEvent from the given input.
`NunchuckCalibrationData` | `getCalibrationData()` Returns the calibration information for the Nunchuck.
`short` | `getCode()` Returns the extension code for this extension, used by WRExtensionFactories in determining what kind of if the given extension is this kind of extension.
`boolean` | `isPayloadValid(int payload)` Checks if the given payload is valid for this extension.

Methods inherited from class wiiremotej.WRExtension
`getPayload`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### WRNunchuckExtension

    public WRNunchuckExtension(int payload)

  Creates a new WRNunchuckExtension with the given payload.

  Parameters:
    `payload` - the number of bytes needed to create an event with this extension.

Method Detail

### getCalibrationData

    public NunchuckCalibrationData getCalibrationData()

  Returns the calibration information for the Nunchuck.

  Returns:
    the calibration information for the Nunchuck.

### createWRExtensionEvent

    public WRNunchuckExtensionEvent createWRExtensionEvent(WiiRemote source,
                                                           byte[] input,
                                                           int offset)

  Creates and returns a new WRNunchuckExtensionEvent from the given input. Note, this synchronizes on an internal object to prevent button events from being created simultaneously.

  Specified by:
    `createWRExtensionEvent` in class `WRExtension`
  Parameters:
    `source` - the WiiRemote triggering this event.
    `input` - the data input from the nunchuck.
    `offset` - the position of the first byte of extension data in input.
  Returns:
    a new WRNunchuckExtensionEvent.

### isPayloadValid

    public boolean isPayloadValid(int payload)

  Checks if the given payload is valid for this extension. The nunchuck only accepts a payload of 6.

  Specified by:
    `isPayloadValid` in class `WRExtension`
  Parameters:
    `payload` - the payload to check.
  Returns:
    `true` if this extension will accept the given payload; otherwise, `false`.

### getCode

    public short getCode()

  Returns the extension code for this extension, used by WRExtensionFactories in determining what kind of if the given extension is this kind of extension. Note this is the decrypted code.

  Specified by:
    `getCode` in class `WRExtension`
  Returns:
    the extension code for this extension.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD