|
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.Spaceball3003Packet
Generates and decodes data packets for Labtec's Spaceball 2003/3003 device according to the Spaceball 2003/3003 Packet Protocol (alpha3).
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.
NOTE: Implementation not finished and not tested. Any feedback welcome.
Spaceball, Spaceball 2003 and Spaceball 3003 are Trademarks of Labtec Inc.
| Field Summary | |
static int |
BEEPER_QUEUE_OVERFLOW_ERROR_CODE
|
static int |
CALIBRATION_CHECKSUM_ERROR_CODE
|
static byte |
DISABLE_BALL_DATA
This command disables data packets. |
static int |
ENABLE_BALL_DATA
This command enables data packets. |
static byte |
GET_REZERO_BALL
This command causes the Spaceball to rezero. |
static int |
HARDWARE_ERROR_CODE_1
|
static int |
HARDWARE_ERROR_CODE_2
|
static int |
HARDWARE_ERROR_CODE_3
|
static int |
PACKET_TOO_LONG_ERROR_CODE
|
static int |
RECEIVE_ERROR_CODE
|
static int |
RECEIVE_OVERFLOW_ERROR_ERROR_CODE
|
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 | |
Spaceball3003Packet()
|
|
| Method Summary | |
static int |
createEnableDevicePacket(byte[] data,
int offset)
Creates a simple request packet (packet which consists only of a header). |
static void |
decodeButtonEvent(int[] buttonData,
byte[] readBuffer,
int packetStart)
|
static void |
doCallBacks(byte[] readBuffer,
Spaceball3003CallbackInterface 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 HARDWARE_ERROR_CODE_1
public static final int CALIBRATION_CHECKSUM_ERROR_CODE
public static final int HARDWARE_ERROR_CODE_2
public static final int HARDWARE_ERROR_CODE_3
public static final int TRANSMIT_TIMEOUT_ERROR_CODE
public static final int RECEIVE_OVERFLOW_ERROR_ERROR_CODE
public static final int RECEIVE_ERROR_CODE
public static final int BEEPER_QUEUE_OVERFLOW_ERROR_CODE
public static final int PACKET_TOO_LONG_ERROR_CODE
public static final int ENABLE_BALL_DATA
public static final byte DISABLE_BALL_DATA
public static final byte GET_REZERO_BALL
| Constructor Detail |
public Spaceball3003Packet()
| Method Detail |
public static int createEnableDevicePacket(byte[] data,
int offset)
data - buffer into which the packet will be copied;
Packet size = 2 bytes.offset - first byte of packet will be copied at
data[offset]
public static void decodeButtonEvent(int[] buttonData,
byte[] readBuffer,
int packetStart)
public static void doCallBacks(byte[] readBuffer,
Spaceball3003CallbackInterface caller,
int dataStart,
int dataLength,
int header)
dataStart - start of data packet in readBuffer excluding
headerdataLength - length of data packet excluding header and packet
terminator
|
j3d.org Code | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||