Public Member Functions | |
String | getDescription () |
int | getErrorNumber () |
PhidgetException (int errno, String description) | |
String | toString () |
Static Public Attributes | |
static final int | EEPHIDGET_BADPASSWORD = 0x8002 |
static final int | EEPHIDGET_BADPOWER = 0x9008 |
static final int | EEPHIDGET_BADVERSION = 0x8003 |
static final int | EEPHIDGET_NETWORK = 0x8001 |
static final int | EEPHIDGET_OUTOFRANGE = 0x9007 |
static final int | EEPHIDGET_OVERCURRENT = 0x9006 |
static final int | EEPHIDGET_OVERRUN = 0x9002 |
static final int | EEPHIDGET_OVERTEMP = 0x9005 |
static final int | EEPHIDGET_PACKETLOST = 0x9003 |
static final int | EEPHIDGET_WRAP = 0x9004 |
static final int | EPHIDGET_BADPASSWORD = 10 |
static final int | EPHIDGET_BADVERSION = 19 |
static final int | EPHIDGET_CLOSED = 18 |
static final int | EPHIDGET_DUPLICATE = 12 |
static final int | EPHIDGET_EVENT = 15 |
static final int | EPHIDGET_INTERRUPTED = 6 |
static final int | EPHIDGET_INVALID = 7 |
static final int | EPHIDGET_INVALIDARG = 4 |
static final int | EPHIDGET_NETWORK = 8 |
static final int | EPHIDGET_NETWORK_NOTCONNECTED = 16 |
static final int | EPHIDGET_NOMEMORY = 2 |
static final int | EPHIDGET_NOTATTACHED = 5 |
static final int | EPHIDGET_NOTFOUND = 1 |
static final int | EPHIDGET_OUTOFBOUNDS = 14 |
static final int | EPHIDGET_TIMEOUT = 13 |
static final int | EPHIDGET_UNEXPECTED = 3 |
static final int | EPHIDGET_UNKNOWNVAL = 9 |
static final int | EPHIDGET_UNSUPPORTED = 11 |
static final int | EPHIDGET_WRONGDEVICE = 17 |
Private Attributes | |
String | description |
int | errno |
This class represents Phidget related exceptions. All Phidget exceptions originate in the phidget21 C library. These exceptions can be thrown by most function in the library and cover such things as trying to access a Phidget before opening it, or before it is attached and ready to use, out of bounds Index and data values, trying to read data that isn't available, and other less common problems. EPHIDGET_(error) errors are thrown by any API calls, EEPHIDGET_(error) errors are returned via the Error event.
Definition at line 14 of file PhidgetException.java.
com.phidgets.PhidgetException.PhidgetException | ( | int | errno, |
String | description | ||
) | [inline] |
Constructor which takes in an error number and description. These exceptions originate from and are filled in by the phidget 21 C library.
Definition at line 22 of file PhidgetException.java.
String com.phidgets.PhidgetException.getDescription | ( | ) | [inline] |
Returns a description of this exception. This is an english phrase that describes the exception that occured. These strings originate in the base phidget21 C library, and should help to diagnose problems.
Definition at line 325 of file PhidgetException.java.
int com.phidgets.PhidgetException.getErrorNumber | ( | ) | [inline] |
Returns the error number of this exception. This error number will match one of the EPHIDGET_(error) or EEPHIDGET_(error) constants defined in this class. These numbers are defined in the phidget21 c library and are consistent across all APIs.
There are 19 error codes defined, as follows:
EPHIDGET_NOTFOUND, EPHIDGET_NOMEMORY, EPHIDGET_UNEXPECTED, EPHIDGET_INVALIDARG, EPHIDGET_NOTATTACHED, EPHIDGET_INTERRUPTED, EPHIDGET_INVALID, EPHIDGET_NETWORK, EPHIDGET_UNKNOWNVAL, EPHIDGET_BADPASSWORD, EPHIDGET_UNSUPPORTED, EPHIDGET_DUPLICATE, EPHIDGET_TIMEOUT, EPHIDGET_OUTOFBOUNDS, EPHIDGET_EVENT, EPHIDGET_NETWORK_NOTCONNECTED, EPHIDGET_WRONGDEVICE, EPHIDGET_CLOSED and EPHIDGET_BADVERSION
There are also 9 error event codes defined, as follows:
EEPHIDGET_NETWORK, EEPHIDGET_BADPASSWORD, EEPHIDGET_BADVERSION, EEPHIDGET_OVERRUN, EEPHIDGET_PACKETLOST, EEPHIDGET_WRAP, EEPHIDGET_OVERTEMP, EEPHIDGET_OVERCURRENT, EEPHIDGET_OUTOFRANGE
Definition at line 315 of file PhidgetException.java.
String com.phidgets.PhidgetException.toString | ( | ) | [inline] |
Returns a string containing the error number and exception description.
Definition at line 334 of file PhidgetException.java.
String com.phidgets.PhidgetException.description [private] |
Definition at line 16 of file PhidgetException.java.
final int com.phidgets.PhidgetException.EEPHIDGET_BADPASSWORD = 0x8002 [static] |
Authorization exception. "Authorization Failed."
This exception is sent via the Error event. It means that a connection could not be authenticated because of a passwrod missmatch.
This is returned by getErrorNumber
Definition at line 209 of file PhidgetException.java.
final int com.phidgets.PhidgetException.EEPHIDGET_BADPOWER = 0x9008 [static] |
Bad power exception. "Power supply problem detected."
This exception sent via in the Error event. It is accompanied by a specific description.
This is returned by getErrorNumber
Definition at line 273 of file PhidgetException.java.
final int com.phidgets.PhidgetException.EEPHIDGET_BADVERSION = 0x8003 [static] |
Version mismatch exception. "Webservice and Client protocol versions don't match. Update to newest release."
This exception is sent via the Error event when trying to connect to a remote phidget and the webservice version does not match your client library version.
This is returned by getErrorNumber
Definition at line 217 of file PhidgetException.java.
final int com.phidgets.PhidgetException.EEPHIDGET_NETWORK = 0x8001 [static] |
Network exception. "Network Error."
This exception is sent via the Error event. It will be accompanied by a specific Description of the network problem.
This is returned by getErrorNumber
Definition at line 201 of file PhidgetException.java.
final int com.phidgets.PhidgetException.EEPHIDGET_OUTOFRANGE = 0x9007 [static] |
Out of range exception. "Out of range condition detected."
This exception sent via in the Error event. It is accompanied by a specific description.
This is returned by getErrorNumber
Definition at line 265 of file PhidgetException.java.
final int com.phidgets.PhidgetException.EEPHIDGET_OVERCURRENT = 0x9006 [static] |
Overcurrent exception. "Overcurrent condition detected."
This exception sent via in the Error event. It is accompanied by a specific description.
This is returned by getErrorNumber
Definition at line 257 of file PhidgetException.java.
final int com.phidgets.PhidgetException.EEPHIDGET_OVERRUN = 0x9002 [static] |
Overrun exception. "A sampling overrun happend in firmware."
This exception sent via in the Error event. It is accompanied by a specific description.
This is returned by getErrorNumber
Definition at line 225 of file PhidgetException.java.
final int com.phidgets.PhidgetException.EEPHIDGET_OVERTEMP = 0x9005 [static] |
Overtemperature exception. "Overtemperature condition detected."
This exception sent via in the Error event. It is accompanied by a specific description.
This is returned by getErrorNumber
Definition at line 249 of file PhidgetException.java.
final int com.phidgets.PhidgetException.EEPHIDGET_PACKETLOST = 0x9003 [static] |
Packet lost exception. "One or more packets were lost."
This exception sent via in the Error event. It is accompanied by a specific description.
This is returned by getErrorNumber
Definition at line 233 of file PhidgetException.java.
final int com.phidgets.PhidgetException.EEPHIDGET_WRAP = 0x9004 [static] |
Wraparound exception. "A variable has wrapped around."
This exception sent via in the Error event. It is accompanied by a specific description.
This is returned by getErrorNumber
Definition at line 241 of file PhidgetException.java.
final int com.phidgets.PhidgetException.EPHIDGET_BADPASSWORD = 10 [static] |
Authorization exception. "Authorization Failed."
This exception has been replaced by EEPHIDGET_BADPASSWORD.
This is returned by getErrorNumber
Definition at line 114 of file PhidgetException.java.
final int com.phidgets.PhidgetException.EPHIDGET_BADVERSION = 19 [static] |
Version mismatch exception. "Webservice and Client protocol versions don't match. Update to newest release."
This exception has been replaced by EEPHIDGET_BADVERSION.
This is returned by getErrorNumber
Definition at line 189 of file PhidgetException.java.
final int com.phidgets.PhidgetException.EPHIDGET_CLOSED = 18 [static] |
Phidget closed exception. "Phidget handle was closed."
This exception is thrown when waitForAttachment is called on a Phidget that has not been opened, or was closed.
This is returned by getErrorNumber
Definition at line 181 of file PhidgetException.java.
final int com.phidgets.PhidgetException.EPHIDGET_DUPLICATE = 12 [static] |
Duplicate request exception. "Duplicated request."
This exception is thrown when open is called twice on a device, without calling close in between. The second call to open is ignored.
This is returned by getErrorNumber
Definition at line 132 of file PhidgetException.java.
final int com.phidgets.PhidgetException.EPHIDGET_EVENT = 15 [static] |
Event exception. "A non-null error code was returned from an event handler."
This exception is not currently used.
This is returned by getErrorNumber
Definition at line 157 of file PhidgetException.java.
final int com.phidgets.PhidgetException.EPHIDGET_INTERRUPTED = 6 [static] |
Interrupted exception. "Read/Write operation was interrupted."
This exception is not currently used externally.
This is returned by getErrorNumber
Definition at line 76 of file PhidgetException.java.
final int com.phidgets.PhidgetException.EPHIDGET_INVALID = 7 [static] |
Invalid error exception. "The Error Code is not defined."
This exception is thrown when trying to get the string description of an undefined error code. This should not be seen in Java.
This is returned by getErrorNumber
Definition at line 84 of file PhidgetException.java.
final int com.phidgets.PhidgetException.EPHIDGET_INVALIDARG = 4 [static] |
Invalid argument exception. "Invalid argument passed to function."
This exception is thrown whenever a function receives an unexpected null pointer, or a value that is out of range. ie setting a motor's speed to 101 when the maximum is 100.
This is returned by getErrorNumber
Definition at line 59 of file PhidgetException.java.
final int com.phidgets.PhidgetException.EPHIDGET_NETWORK = 8 [static] |
Network exception. "Network Error."
This exception is thrown when a network related error occurs. The EEPHIDGET_NETWORK code is more often used (in error events) because most network exceptions come through asynchronously.
This is returned by getErrorNumber
Definition at line 93 of file PhidgetException.java.
final int com.phidgets.PhidgetException.EPHIDGET_NETWORK_NOTCONNECTED = 16 [static] |
Network not connected exception. "A connection to the server does not exist."
This exception is thrown when a network specific method is called on a device that was opened remotely, but there is no connection to a server. ie getServerID.
This is returned by getErrorNumber
Definition at line 165 of file PhidgetException.java.
final int com.phidgets.PhidgetException.EPHIDGET_NOMEMORY = 2 [static] |
No memory exception. "Memory could not be allocated."
This exception is thrown when a memory allocation (malloc) call fails in the c library.
This is returned by getErrorNumber
Definition at line 42 of file PhidgetException.java.
final int com.phidgets.PhidgetException.EPHIDGET_NOTATTACHED = 5 [static] |
Phidget not attached exception. "Phidget not physically attached."
This exception is thrown when a method is called on a device that is not attached, and the method requires the device to be attached. ie trying to read the serial number, or the state of an ouput.
This is returned by getErrorNumber
Definition at line 68 of file PhidgetException.java.
final int com.phidgets.PhidgetException.EPHIDGET_NOTFOUND = 1 [static] |
Phidget not found exception. "A Phidget matching the type and or serial number could not be found."
This exception is not currently used externally.
This is returned by getErrorNumber
Definition at line 34 of file PhidgetException.java.
final int com.phidgets.PhidgetException.EPHIDGET_OUTOFBOUNDS = 14 [static] |
Out of bounds exception. "Index out of Bounds."
This exception is thrown anytime an indexed set or get method is called with an out of bounds index.
This is returned by getErrorNumber
Definition at line 149 of file PhidgetException.java.
final int com.phidgets.PhidgetException.EPHIDGET_TIMEOUT = 13 [static] |
Timeout exception. "Given timeout has been exceeded."
This exception is thrown by waitForAttachment(int) if the provided timeout expires before an attach happens. This may also be thrown by a device set request, if the set times out - though this should not happen, and would generally mean a problem with the device.
This is returned by getErrorNumber
Definition at line 141 of file PhidgetException.java.
final int com.phidgets.PhidgetException.EPHIDGET_UNEXPECTED = 3 [static] |
Unexpected exception. "Unexpected Error. Contact Phidgets Inc. for support."
This exception is thrown when something unexpected happens (more enexpected then another exception). This generally points to a bug or bad code in the C library, and hopefully won't even be seen.
This is returned by getErrorNumber
Definition at line 51 of file PhidgetException.java.
final int com.phidgets.PhidgetException.EPHIDGET_UNKNOWNVAL = 9 [static] |
Value unknown exception. "Value is Unknown (State not yet received from device, or not yet set by user)."
This exception is thrown when a device that is set to unknow is read. ie trying to read the position of a servo before setting it's position.
Every effort is made in the library to fill in as much of a device's state before the attach event gets thrown, however, many there are some states that cannot be filled in automatically. ie older interface kits do not return their output states, and so these will be unknown until they are set.
This is a quite common exception for some devices, and so should always be caught
This is returned by getErrorNumber
Definition at line 106 of file PhidgetException.java.
final int com.phidgets.PhidgetException.EPHIDGET_UNSUPPORTED = 11 [static] |
Unsupported exception. "Not Supported."
This exception is thrown when a method is called that is not supported, either by that device, or by the system. ie calling setRatiometric on an interfaceKit that does not have sensors.
This is also used for methods that are not yet complete, ie setLabel on Windows.
This is returned by getErrorNumber
Definition at line 124 of file PhidgetException.java.
final int com.phidgets.PhidgetException.EPHIDGET_WRONGDEVICE = 17 [static] |
Wrong device exception. "Function is not applicable for this device."
This exception is thrown when a method from device is called by another device. ie casting an InterfaceKit to a Servo and calling setPosition.
This is returned by getErrorNumber
Definition at line 173 of file PhidgetException.java.
int com.phidgets.PhidgetException.errno [private] |
Definition at line 15 of file PhidgetException.java.