|
j3d.org Code | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.j3d.device.input.spaceball.SpaceballPacket
org.j3d.device.input.spaceball.Spaceball4000Packet
Generates and decodes data packets for Labtec's Spaceball 4000 device according to the Spaceball 4000 Packet Protocol v1.2.
NOTE: Some data packets will contain an additional "special character" ('^' - 0x5e) inserted within the data stream. This escape character notifies the system to modify the following byte. If the following byte is 'Q', (0x51), 'S' (0x53), or an 'M' (0x4d) the seventh bit should be cleared. (Which should result in 0x11, 0x13, 0x0d respectively.) If the following character is a second '^' (0x5e) then no modification should be made. (Do not forget to remove the '^' character from the packet buffer.). This is currently not implemented. Therefore certain data packets may be ignored, specially if buttons 3 and 4 are pressed at the same time.
NOTE: The Ignore Packet is not implemented.
Spaceball and Spaceball 4000 are Trademarks of Labtec Inc.
| Field Summary | |
static byte |
ADVANCED_BUTTON_DATA
This command causes the Spaceball to RESET. |
static byte |
AUTO_REZERO_RESPONSE
|
static byte |
CHANGE_AUTOMATIC_ZERO_PARAMETERS
|
static int |
COMMAND_UNRECOGNIZED_ERROR_CODE
|
static byte |
CUBIC_SENSITIVITY_ENABLE_DISABLE
|
static byte |
CUBIC_SENSITIVITY_ENABLED
constant for cubic sensitivity |
static byte |
DISABLE_BALL_DATA
This command disables data packets. |
static int |
ECLIPSE_REGISTER_ERROR_CODE
|
static int |
ECLIPSE_TIMED_OUT_ERROR_CODE
|
static int |
EEPROM_CHECKSUM_INCORRECT_ERROR_CODE
|
static byte |
EMIT_SINGLE_BEEP
This command causes the Spaceball 4000 to single beep. |
static byte |
ENABLE_BALL_DATA
This command enables data packets. |
static byte |
ENABLE_DISABLE_AUTO_REZERO
|
static byte |
GET_DEVICE_DESCRIPTOR
This command requests the Spaceball 4000-specific reset string. |
static byte |
GET_DEVICE_INFORMATION
This command requests the firmware version and build date. |
static byte |
GET_DEVICE_INFORMATION_RESPONSE
|
static byte |
GET_REZERO_BALL
This command causes the Spaceball to rezero. |
static int |
LEFT
constant for left handedness |
static int |
PACKET_IGNORED_ERROR_CODE
|
static int |
PACKET_TOO_LONG_ERROR_CODE
|
static int |
RECEIVE_ERROR_ERROR_CODE
|
static int |
RECEIVE_QUEUE_OVERFLOW_ERROR_CODE
|
static int |
RIGHT
constant for right handedness |
static byte |
STANDARD_SENSITIVITY_ENABLED
constant for standard sensitivity |
static int |
TRANSMIT_TIMEOUT_ERROR_CODE
|
| Fields inherited from class org.j3d.device.input.spaceball.SpaceballPacket |
BALL_DATA, BUTTON_DATA, BUTTON_DATA_PACKET_LENGTH, BUTTON_MASK, ECHO, ERROR, PACKET_TERMINATOR, PATTERNED_BEEP, POSITION_DATA_PACKET_LENGTH, RESET_DEVICE |
| Constructor Summary | |
Spaceball4000Packet()
|
|
| Method Summary | |
static int |
createChangeAutomaticZeroParametersPacket(byte[] data,
int offset,
int autoZeroPeriod,
int autoZeroWindow)
Sets a flag in the EEPROM to enable automatic rezero. |
static int |
createCubicSensitivityEnableDisablePacket(byte[] data,
int offset,
boolean enable)
This command causes the Spaceball 4000 to use or not to use the cubic sensitivity curve for the ball data transmitted. |
static int |
createEnableDisableAutoRezeroPacket(byte[] data,
int offset,
boolean enable)
This command causes the Spaceball 4000 not to use the auto-rezero function in the device. |
static void |
decodeButtonEvent(int[] buttonData,
byte[] readBuffer,
Spaceball4000CallbackInterface caller,
int packetStart)
|
static void |
doCallBacks(byte[] readBuffer,
Spaceball4000CallbackInterface caller,
int dataStart,
int dataLength,
int header)
|
| Methods inherited from class org.j3d.device.input.spaceball.SpaceballPacket |
createEchoPacket, createPatternedBeepPacket, createSimpleRequestPacket, decodeBallData, decodeButtonData, makeWord |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int ECLIPSE_REGISTER_ERROR_CODE
public static final int EEPROM_CHECKSUM_INCORRECT_ERROR_CODE
public static final int ECLIPSE_TIMED_OUT_ERROR_CODE
public static final int TRANSMIT_TIMEOUT_ERROR_CODE
public static final int RECEIVE_QUEUE_OVERFLOW_ERROR_CODE
public static final int RECEIVE_ERROR_ERROR_CODE
public static final int PACKET_TOO_LONG_ERROR_CODE
public static final int PACKET_IGNORED_ERROR_CODE
public static final int COMMAND_UNRECOGNIZED_ERROR_CODE
public static final byte EMIT_SINGLE_BEEP
public static final byte ENABLE_BALL_DATA
public static final byte DISABLE_BALL_DATA
public static final byte GET_DEVICE_DESCRIPTOR
public static final byte GET_REZERO_BALL
public static final byte ADVANCED_BUTTON_DATA
public static final byte CUBIC_SENSITIVITY_ENABLE_DISABLE
public static final byte ENABLE_DISABLE_AUTO_REZERO
public static final byte CHANGE_AUTOMATIC_ZERO_PARAMETERS
public static final byte AUTO_REZERO_RESPONSE
public static final byte GET_DEVICE_INFORMATION
public static final byte GET_DEVICE_INFORMATION_RESPONSE
public static final int LEFT
public static final int RIGHT
public static final byte CUBIC_SENSITIVITY_ENABLED
public static final byte STANDARD_SENSITIVITY_ENABLED
| Constructor Detail |
public Spaceball4000Packet()
| Method Detail |
public static int createCubicSensitivityEnableDisablePacket(byte[] data,
int offset,
boolean enable)
data - buffer into which the packet will be copied;
packet size = 3 byteoffset - first byte of packet will be copied at "data[offset]"enable - true: cubic sensitivity will be enabled
public static int createEnableDisableAutoRezeroPacket(byte[] data,
int offset,
boolean enable)
data - buffer into which the packet will be copied;
packet size = 3 byteoffset - first byte of packet will be copied at "data[offset]"enable - true: auto rezero will be enabled
public static int createChangeAutomaticZeroParametersPacket(byte[] data,
int offset,
int autoZeroPeriod,
int autoZeroWindow)
data - buffer into which the packet will be copied;
packet size = 8 byteoffset - first byte of packet will be copied at "data[offset]"autoZeroPeriod - [ms] 0 <= "autoZeroPeriod" <= 0xFFFF Set to zero to
disable automatic zeroing capabilities.autoZeroWindow - [raw reading units] 0 <= "autoZeroWindow" <= 0xFF
public static void decodeButtonEvent(int[] buttonData,
byte[] readBuffer,
Spaceball4000CallbackInterface caller,
int packetStart)
public static void doCallBacks(byte[] readBuffer,
Spaceball4000CallbackInterface caller,
int dataStart,
int dataLength,
int header)
|
j3d.org Code | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||