Package org.osgi.service.zigbee
Class ZigBeeException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- org.osgi.service.zigbee.ZigBeeException
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
APSException,ZCLException,ZDPException
public class ZigBeeException extends java.lang.RuntimeExceptionThis class represents root exception for all the code related to ZigBee. The provided constants names, but not the values.- Author:
- $Id: c679d422f7d3d2fe33229cb667d827b878da73cd $
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected interrorCodeThe error code associated to this exception.static intOSGI_EXISTING_IDThe error code used when another endpoint exists with the same ID.static intOSGI_MULTIPLE_HOSTSThe error code used when several hosts exist for this PAN ID target or HOST_PID target.static intTIMEOUTThe error code used when the timeout of ZigBee asynchronous exchange is reached.static intUNKNOWN_ERRORThis error code is used if the ZigBee error returned is not covered by this API specification.protected intzigBeeErrorCodeThe actual error code returned by the ZigBee node.
-
Constructor Summary
Constructors Constructor Description ZigBeeException(int errorCode, int zigBeeErrorCode, java.lang.String errorDesc)ZigBeeException(int errorCode, java.lang.String errorDesc)Creates a ZigBeeException containing a specificerrorCode.ZigBeeException(java.lang.String errorDesc)Creates a ZigBeeException containing only a description, but no error codes.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetErrorCode()Returns the error code.intgetZigBeeErrorCode()Returns the potential ZigBee error code.booleanhasZigBeeErrorCode()Checks if this exception has a ZigBee error code.
-
-
-
Field Detail
-
OSGI_EXISTING_ID
public static final int OSGI_EXISTING_ID
The error code used when another endpoint exists with the same ID.- See Also:
- Constant Field Values
-
OSGI_MULTIPLE_HOSTS
public static final int OSGI_MULTIPLE_HOSTS
The error code used when several hosts exist for this PAN ID target or HOST_PID target.- See Also:
- Constant Field Values
-
TIMEOUT
public static final int TIMEOUT
The error code used when the timeout of ZigBee asynchronous exchange is reached.- See Also:
- Constant Field Values
-
UNKNOWN_ERROR
public static final int UNKNOWN_ERROR
This error code is used if the ZigBee error returned is not covered by this API specification.- See Also:
- Constant Field Values
-
errorCode
protected final int errorCode
The error code associated to this exception.- See Also:
getErrorCode()
-
zigBeeErrorCode
protected final int zigBeeErrorCode
The actual error code returned by the ZigBee node.- See Also:
getZigBeeErrorCode()
-
-
Constructor Detail
-
ZigBeeException
public ZigBeeException(java.lang.String errorDesc)
Creates a ZigBeeException containing only a description, but no error codes. If issued on this exception thegetErrorCode()andgetZigBeeErrorCode()methods return theUNKNOWN_ERRORconstant.- Parameters:
errorDesc- exception error description.
-
ZigBeeException
public ZigBeeException(int errorCode, java.lang.String errorDesc)Creates a ZigBeeException containing a specificerrorCode. Using this constructor witherrorCodeset toUNKNOWN_ERRORis equivalent to callZigBeeException(String).- Parameters:
errorCode- One of the error codes defined in this interface orUNKNOWN_ERRORif the actual error is not listed in this interface.errorDesc- An error description which explain the type of problem.
-
ZigBeeException
public ZigBeeException(int errorCode, int zigBeeErrorCode, java.lang.String errorDesc)Creates a ZigBeeException containing a specificerrorCodeorzigBeeErrorCode. Using this constructor with both theerrorCodeandzigBeeErrorCodeset toUNKNOWN_ERRORis equivalent to callZigBeeException(String).- Parameters:
errorCode- One of the error codes defined in this interface orUNKNOWN_ERRORthe actual error is not covered in this interface.zigBeeErrorCode- The actual status code orUNKNOWN_ERRORif this status is unknown.errorDesc- An error description which explain the type of problem.
-
-
Method Detail
-
getZigBeeErrorCode
public int getZigBeeErrorCode()
Returns the potential ZigBee error code.- Returns:
- One of the error codes defined above. If the returned error code
is
UNKNOWN_ERRORand thehasZigBeeErrorCode()returnstruethen thegetZigBeeErrorCode()provides the actual ZigBee error code returned by the device.
-
getErrorCode
public int getErrorCode()
Returns the error code.- Returns:
- the error code.
-
hasZigBeeErrorCode
public boolean hasZigBeeErrorCode()
Checks if this exception has a ZigBee error code.- Returns:
- true if the
ZigBeeExceptionconvey also the actual error code returned by the ZigBee stack.
-
-