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:
Serializable
- Direct Known Subclasses:
APSException
,ZCLException
,ZDPException
This class represents root exception for all the code related to ZigBee. The
provided constants names, but not the values.
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprotected final int
The error code associated to this exception.static final int
The error code used when another endpoint exists with the same ID.static final int
The error code used when several hosts exist for this PAN ID target or HOST_PID target.static final int
The error code used when the timeout of ZigBee asynchronous exchange is reached.static final int
This error code is used if the ZigBee error returned is not covered by this API specification.protected final int
The actual error code returned by the ZigBee node. -
Constructor Summary
ConstructorDescriptionZigBeeException
(int errorCode, int zigBeeErrorCode, String errorDesc) ZigBeeException
(int errorCode, String errorDesc) Creates a ZigBeeException containing a specificerrorCode
.ZigBeeException
(String errorDesc) Creates a ZigBeeException containing only a description, but no error codes. -
Method Summary
Modifier and TypeMethodDescriptionint
Returns the error code.int
Returns the potential ZigBee error code.boolean
Checks if this exception has a ZigBee error code.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Field Details
-
OSGI_EXISTING_ID
public static final int OSGI_EXISTING_IDThe error code used when another endpoint exists with the same ID.- See Also:
-
OSGI_MULTIPLE_HOSTS
public static final int OSGI_MULTIPLE_HOSTSThe error code used when several hosts exist for this PAN ID target or HOST_PID target.- See Also:
-
TIMEOUT
public static final int TIMEOUTThe error code used when the timeout of ZigBee asynchronous exchange is reached.- See Also:
-
UNKNOWN_ERROR
public static final int UNKNOWN_ERRORThis error code is used if the ZigBee error returned is not covered by this API specification.- See Also:
-
errorCode
protected final int errorCodeThe error code associated to this exception.- See Also:
-
zigBeeErrorCode
protected final int zigBeeErrorCodeThe actual error code returned by the ZigBee node.- See Also:
-
-
Constructor Details
-
ZigBeeException
Creates a ZigBeeException containing only a description, but no error codes. If issued on this exception thegetErrorCode()
andgetZigBeeErrorCode()
methods return theUNKNOWN_ERROR
constant.- Parameters:
errorDesc
- exception error description.
-
ZigBeeException
Creates a ZigBeeException containing a specificerrorCode
. Using this constructor witherrorCode
set toUNKNOWN_ERROR
is equivalent to callZigBeeException(String)
.- Parameters:
errorCode
- One of the error codes defined in this interface orUNKNOWN_ERROR
if the actual error is not listed in this interface.errorDesc
- An error description which explain the type of problem.
-
ZigBeeException
Creates a ZigBeeException containing a specificerrorCode
orzigBeeErrorCode
. Using this constructor with both theerrorCode
andzigBeeErrorCode
set toUNKNOWN_ERROR
is equivalent to callZigBeeException(String)
.- Parameters:
errorCode
- One of the error codes defined in this interface orUNKNOWN_ERROR
the actual error is not covered in this interface.zigBeeErrorCode
- The actual status code orUNKNOWN_ERROR
if this status is unknown.errorDesc
- An error description which explain the type of problem.
-
-
Method Details
-
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_ERROR
and thehasZigBeeErrorCode()
returnstrue
then 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
ZigBeeException
convey also the actual error code returned by the ZigBee stack.
-