javax.bluetooth
Class BluetoothConnectionException

java.lang.Object
  |
  +--java.lang.Throwable
        |
        +--java.lang.Exception
              |
              +--java.io.IOException
                    |
                    +--javax.bluetooth.BluetoothConnectionException

public class BluetoothConnectionException
extends IOException

This BluetoothConnectionException is thrown when a Bluetooth connection (L2CAP, RFCOMM, or OBEX over RFCOMM) cannot be established successfully. The fields in this exception class indicate the cause of the exception. For example, an L2CAP connection may fail due to a security problem. This reason is passed on to the application through this class.

Since:
JDE 4.2.1

Field Summary
static int FAILED_NOINFO
          Indicates the connection to the server failed due to unknown reasons.
static int NO_RESOURCES
          Indicates the connection failed due to a lack of resources either on the local device or on the remote device.
static int SECURITY_BLOCK
          Indicates the connection failed because the security settings on the local device or the remote device were incompatible with the request.
static int TIMEOUT
          Indicates the connection to the server failed due to a timeout.
static int UNACCEPTABLE_PARAMS
          Indicates the connection failed because the configuration parameters provided were not acceptable to either the remote device or the local device.
static int UNKNOWN_PSM
          Indicates the connection to the server failed because no service for the given PSM was registered.
 
Constructor Summary
BluetoothConnectionException(int error)
          Creates a new BluetoothConnectionException with the error indicator specified.
BluetoothConnectionException(int error, String msg)
          Creates a new BluetoothConnectionException with the error indicator and message specified.
 
Method Summary
 int getStatus()
          Gets the status set in the constructor that will indicate the reason for the exception.
 
Methods inherited from class java.lang.Throwable
getMessage, printStackTrace, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

FAILED_NOINFO

public static final int FAILED_NOINFO
Indicates the connection to the server failed due to unknown reasons.

The value for FAILED_NOINFO is 0x0004 (4).

Since:
JDE 4.2.1

NO_RESOURCES

public static final int NO_RESOURCES
Indicates the connection failed due to a lack of resources either on the local device or on the remote device.

The value for NO_RESOURCES is 0x0003 (3).

Since:
JDE 4.2.1

SECURITY_BLOCK

public static final int SECURITY_BLOCK
Indicates the connection failed because the security settings on the local device or the remote device were incompatible with the request.

The value for SECURITY_BLOCK is 0x0002 (2).

Since:
JDE 4.2.1

TIMEOUT

public static final int TIMEOUT
Indicates the connection to the server failed due to a timeout.

The value for TIMEOUT is 0x0005 (5).

Since:
JDE 4.2.1

UNACCEPTABLE_PARAMS

public static final int UNACCEPTABLE_PARAMS
Indicates the connection failed because the configuration parameters provided were not acceptable to either the remote device or the local device.

The value for UNACCEPTABLE_PARAMS is 0x0006 (6).

Since:
JDE 4.2.1

UNKNOWN_PSM

public static final int UNKNOWN_PSM
Indicates the connection to the server failed because no service for the given PSM was registered.

The value for UNKNOWN_PSM is 0x0001 (1).

Since:
JDE 4.2.1
Constructor Detail

BluetoothConnectionException

public BluetoothConnectionException(int error)
Creates a new BluetoothConnectionException with the error indicator specified.
Parameters:
error - indicates the exception condition; must be one of the constants described in this class
Throws:
IllegalArgumentException - if the input value is not one of the constants in this class
Since:
JDE 4.2.1

BluetoothConnectionException

public BluetoothConnectionException(int error,
                                    String msg)
Creates a new BluetoothConnectionException with the error indicator and message specified.
Parameters:
error - indicates the exception condition; must be one of the constants described in this class
msg - a description of the exception; may by null
Throws:
IllegalArgumentException - if the input value is not one of the constants in this class
Since:
JDE 4.2.1
Method Detail

getStatus

public int getStatus()
Gets the status set in the constructor that will indicate the reason for the exception.
Returns:
cause for the exception; will be one of the constants defined in this class
Since:
JDE 4.2.1



Copyright 1999-2009 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.