j3d.org Code

org.j3d.device.input.spaceball
Interface Spaceball4000CallbackInterface

All Known Implementing Classes:
Spaceball4000Driver

public interface Spaceball4000CallbackInterface

Interface for processing events sent from Labtec's Spaceball 4000 device.

Spaceball and Spaceball 4000 are Trademarks of Labtec Inc.

Version:
14. Aug. 2001 Copyright (c) Dipl. Ing. Paul Szawlowski
Author:
Dipl. Ing. Paul Szawlowski - University of Vienna, Dept. of Medical Computer Sciences

Method Summary
 void processAutoRezeroResponse(int autoZeroPeriod, int autoZeroWindow, boolean enabled)
          Method for processing auto rezero responses.
 void processDeviceInfoResponse(int type, int lineNumber, java.lang.String content)
          Method for processing device info events.
 void processEchoResponse(byte[] data)
          Method to process echo respones.
 void processError(int errorCode, java.lang.String errorString)
          Method to process error responses.
 void processRequestResponse(int type)
           
 void processSensitivityResponse(byte value)
          Method for processing sensitivity Responses.
 void setHandedness(int handedness)
          Method to process the handedness response.
 void setNumOfButtons(int numOfButtons)
          Method to process the number of buttons of the device.
 

Method Detail

processRequestResponse

public void processRequestResponse(int type)
Parameters:
type - use constants
  • Spaceball4000Packet.EMIT_SINGLE_BEEP
  • Spaceball4000Packet.ENABLE_BALL_DATA
  • Spaceball4000Packet.DISABLE_BALL_DATA
  • Spaceball4000Packet.GET_REZERO_BALL

processDeviceInfoResponse

public void processDeviceInfoResponse(int type,
                                      int lineNumber,
                                      java.lang.String content)
Method for processing device info events. A device info may consist of up to 4 packets containing a string. This method is called for each packet separately.

Parameters:
type - use constants
  • Spaceball4000Packet.GET_DEVICE_DESCRIPTOR
    1. "Spaceball 4000 FLX"
    2. "B:BB H PnP:p Az:a Sns:s OOOO WW"
      • BB Number of buttons (in decimal)
      • H Handedness of device (L for left, R for right)
      • p 0 if PnP (Plug and Play) is disabled, 1 if enabled
      • a 0 if AutoZero is disabled, 1 if enabled
      • s Sensitivity type: S for standard, C for cubic
      • OOOO AutoZero period in Hex (milliseconds)
      • WW AutoZero window in raw reading units
    3. "VX.xx created on mmm-dd-yyyy"
      • X Major firmware version
      • xx Minor firmware version
      • mmm Month firmware was created: Jan-Feb-Mar-Apr-May- Jun-Jul-Aug-Sep-Nov-Dec)
      • dd Day (0-31) firmware was created
      • yyyy Year firmware was created
    4. "Copyright(C) YYYY Spacetec IMC Corporation."
      • YYYY Year firmware was created
  • Spaceball4000Packet.GET_DEVICE_INFORMATION_RESPONSE: "vFirmware version 2.42 created on 24-Oct-1997"
  • Spaceball4000Packet.RESET_DEVICE: When power is applied to the device, it will perform its initialization. During this initialization the current position will be used as the Zero Position. The firmware will then wait a total of 2 seconds before sending the following strings and emitting a double beep:
    1. "Spaceball alive and well after a AAAAAAA reset."
      • AAAAAAA may be one of the following Strings depending on the type of reset detected: "poweron ", "watchdog", "hardware", "software".
    2. "Firmware version 2.42 created on 24-Oct-1997."
lineNumber - starting at 1; lineNumber = 0 means error at decoding the line number
content - the received data

processSensitivityResponse

public void processSensitivityResponse(byte value)
Method for processing sensitivity Responses.

Parameters:
value - use constants
  • Spaceball4000Packet.CUBIC_SENSITIVITY_ENABLED
  • Spaceball4000Packet.STANDARD_SENSITIVITY_ENABLED
other values indicate an error during decoding

processAutoRezeroResponse

public void processAutoRezeroResponse(int autoZeroPeriod,
                                      int autoZeroWindow,
                                      boolean enabled)
Method for processing auto rezero responses.

Parameters:
autoZeroPeriod - [ms] 0 <= autoZeroPeriod <= 0xFFFF
autoZeroWindow - [raw reading units] 0 <= autoZeroWindow < 0xFF
enabled - true if auto-rezero is enabled

setHandedness

public void setHandedness(int handedness)
Method to process the handedness response.

Parameters:
handedness - use constants
  • Spaceball4000Packet.LEFT
  • Spaceball4000Packet.RIGHT

setNumOfButtons

public void setNumOfButtons(int numOfButtons)
Method to process the number of buttons of the device.

Parameters:
numOfButtons -

processError

public void processError(int errorCode,
                         java.lang.String errorString)
Method to process error responses.

Parameters:
errorCode - use constants
  • Spaceball4000Packet.ECLIPSE_REGISTER_ERROR_CODE
  • Spaceball4000Packet.ECLIPSE_REGISTER_ERROR_CODE
  • Spaceball4000Packet.EEPROM_CHECKSUM_INCORRECT_ERROR_CODE
  • Spaceball4000Packet.ECLIPSE_TIMED_OUT_ERROR_CODE
  • Spaceball4000Packet.TRANSMIT_TIMEOUT_ERROR_CODE
  • Spaceball4000Packet.RECEIVE_QUEUE_OVERFLOW_ERROR_CODE
  • Spaceball4000Packet.RECEIVE_ERROR_ERROR_CODE
  • Spaceball4000Packet.PACKET_TOO_LONG_ERROR_CODE
  • Spaceball4000Packet.PACKET_IGNORED_ERROR_CODE
  • Spaceball4000Packet.COMMAND_UNRECOGNIZED_ERROR_CODE

processEchoResponse

public void processEchoResponse(byte[] data)
Method to process echo respones.


j3d.org Code

Latest Info from http://code.j3d.org/
Copyright © 2001 - j3d.org