Provides access to the Bluetooth Serial Port profile.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
BluetoothSerialPort(byte[] uuid,
String serviceName,
int baudRate,
int dataFormat,
int flowControl,
int rxBufferSize,
int txBufferSize,
BluetoothSerialPortListener listener)
Constructs a new BluetoothSerialPort instance for server use.
BluetoothSerialPort(String serviceName,
int baudRate,
int dataFormat,
int flowControl,
int rxBufferSize,
int txBufferSize,
BluetoothSerialPortListener listener)
Constructs a new BluetoothSerialPort instance for server use.
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
BAUD_19200
public static final int BAUD_19200
19200 baud.
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
BAUD_230400
public static final int BAUD_230400
230400 baud.
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
BAUD_2400
public static final int BAUD_2400
2400 baud.
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
BAUD_38400
public static final int BAUD_38400
38400 baud.
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
BAUD_4800
public static final int BAUD_4800
4800 baud.
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
BAUD_57600
public static final int BAUD_57600
57600 baud.
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
BAUD_7200
public static final int BAUD_7200
7200 buad.
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
BAUD_9600
public static final int BAUD_9600
9600 baud.
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
DATA_FORMAT_DATA_BITS_5
public static final int DATA_FORMAT_DATA_BITS_5
Five data bits per byte.
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
DATA_FORMAT_DATA_BITS_6
public static final int DATA_FORMAT_DATA_BITS_6
Six data bits per byte.
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
DATA_FORMAT_DATA_BITS_7
public static final int DATA_FORMAT_DATA_BITS_7
Seven data bits per byte.
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
DATA_FORMAT_DATA_BITS_8
public static final int DATA_FORMAT_DATA_BITS_8
Eight data bits per byte.
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
DATA_FORMAT_PARITY_EVEN
public static final int DATA_FORMAT_PARITY_EVEN
Connection uses even parity (only useful in conjunction with DATA_FORMAT_PARITY_ON).
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
DATA_FORMAT_PARITY_MARK
public static final int DATA_FORMAT_PARITY_MARK
Connection uses mark parity (only useful in conjunction with DATA_FORMAT_PARITY_ON).
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
DATA_FORMAT_PARITY_NONE
public static final int DATA_FORMAT_PARITY_NONE
Connection has no parity.
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
DATA_FORMAT_PARITY_ON
public static final int DATA_FORMAT_PARITY_ON
Connection has parity.
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
DATA_FORMAT_PARITY_SPACE
public static final int DATA_FORMAT_PARITY_SPACE
Connection uses space parity (only useful in conjunction with DATA_FORMAT_PARITY_ON).
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
DATA_FORMAT_STOP_BITS_1
public static final int DATA_FORMAT_STOP_BITS_1
Connection pauses for one bit's transfer time for stop action.
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
DATA_FORMAT_STOP_BITS_1_5
public static final int DATA_FORMAT_STOP_BITS_1_5
Connection pauses for one and a half bit's transfer time for stop action.
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
DEFAULT_UUID
public static final byte[] DEFAULT_UUID
The standard serial port UUID.
Since:
JDE 4.2.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
FLOW_CONTROL_DTR_DSR
public static final int FLOW_CONTROL_DTR_DSR
Connection supports DTR/DSR flow control.
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
FLOW_CONTROL_NONE
public static final int FLOW_CONTROL_NONE
Connection supports no flow control.
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
FLOW_CONTROL_RTC_CTS
public static final int FLOW_CONTROL_RTC_CTS
Connection supports RTC/CTS flow control.
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
FLOW_CONTROL_XON_XOFF
public static final int FLOW_CONTROL_XON_XOFF
Connection supports XON/XOFF flow control.
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
BluetoothSerialPort
public BluetoothSerialPort(byte[] uuid,
String serviceName,
int baudRate,
int dataFormat,
int flowControl,
int rxBufferSize,
int txBufferSize,
BluetoothSerialPortListener listener)
throws IOException
Constructs a new BluetoothSerialPort instance for server use.
Parameters:
uuid - The service class UUID to include in the SDP record; this must be a 16, 32 or 128-bit, big-endian value.
serviceName - The service name to include in the SDP record.
baudRate - One of the BAUD_* values. Note that the baud setting
does not actually affect Bluetooth throughput.
dataFormat - A combination of the DATA_FORMAT_* values.
flowControl - One of the FLOW_CONTROL_* values.
rxBufferSize - Receive buffer size.
txBufferSize - Transmit buffer size.
listener - Listener to receive and handle Bluetooth port events.
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
BluetoothSerialPort
public BluetoothSerialPort(String serviceName,
int baudRate,
int dataFormat,
int flowControl,
int rxBufferSize,
int txBufferSize,
BluetoothSerialPortListener listener)
throws IOException
Constructs a new BluetoothSerialPort instance for server use.
Parameters:
serviceName - The service name to include in the SDP record.
baudRate - One of the BAUD_* values. Note that the baud setting
does not actually affect Bluetooth throughput.
dataFormat - A combination of the DATA_FORMAT_* values.
flowControl - One of the FLOW_CONTROL_* values.
rxBufferSize - Receive buffer size.
txBufferSize - Transmit buffer size.
listener - Listener to receive and handle Bluetooth port events.
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Method Detail
close
public void close()
Closes the serial port.
Invoking this method closes this port, disables the line drivers, and
frees any buffer memory that was allocated when the port was opened.
The system automatically invokes this method when the device is shut
off. Applications may not assume that the port is still open once the
device is powered on again.
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
disconnect
public void disconnect()
Disconnects the serial port.
If this is server port, the connection is severed, and the server is made
ready to accept subsequent connections. If this is a client port, the behaviour
is identical to close().
Since:
JDE 4.1.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
isSupported
public static boolean isSupported()
Determines if this device supports Bluetooth serial ports.
Returns:
True if the device supports Bluetooth serial ports; otherwise,
false.
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Byte read, or a negative number if an error occurred or no bytes
available.
Throws:
IOException - Thrown if the port is not currently open.
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
read
public int read(byte[] data,
int offset,
int length)
throws IOException
Reads some data bytes from the receive buffer.
Invoke this method to stuff only a portion of your data buffer with
bytes from the receive buffer.
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
setDsr
public void setDsr(boolean state)
throws IOException
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
setProperties
public void setProperties(int baudRate,
int dataFormat,
int flowControl)
throws IOException
Deprecated.setProperties is no longer supported
Changes this port's configuration.
Parameters:
baudRate - One of the BAUD_* values. Note that the baud setting
does not actually affect Bluetooth throughput.
dataFormat - A combination of the DATA_FORMAT_* values.
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
write
public int write(byte[] data,
int offset,
int length)
throws IOException
Places some bytes to send into the transmit buffer.
Note that after calling this method, you must wait for the system to
invoke IOPortListener.dataSent()
before writing additional data.
Use this method to place only a portion of a byte array into the
transmit buffer.
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Copyright 1999-2008 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.