BluetoothSocketSettings
public
final
class
BluetoothSocketSettings
extends Object
Defines parameters for creating Bluetooth server and client socket channels.
Used with BluetoothAdapter.listenUsingSocketSettings to create a server socket and
BluetoothDevice.createUsingSocketSettings to create a client socket.
Summary
Nested classes | |
|---|---|
class |
BluetoothSocketSettings.Builder
Builder for |
Public methods | |
|---|---|
int
|
getL2capPsm()
Returns the L2CAP PSM value used for a BluetoothSocket#TYPE_LE socket. |
String
|
getRfcommServiceName()
Returns the RFCOMM service name used for a BluetoothSocket#TYPE_RFCOMM socket. |
UUID
|
getRfcommUuid()
Returns the RFCOMM service UUID used for a BluetoothSocket#TYPE_RFCOMM socket. |
int
|
getSocketType()
Returns the type of the Bluetooth socket. |
boolean
|
isAuthenticationRequired()
Checks if authentication is enabled for the Bluetooth socket. |
boolean
|
isEncryptionRequired()
Checks if encryption is enabled for the Bluetooth socket. |
String
|
toString()
Returns a |
Inherited methods | |
|---|---|
Public methods
getL2capPsm
public int getL2capPsm ()
Returns the L2CAP PSM value used for a BluetoothSocket#TYPE_LE socket.
| Returns | |
|---|---|
int |
Value is between 128 and 255 inclusive |
getRfcommServiceName
public String getRfcommServiceName ()
Returns the RFCOMM service name used for a BluetoothSocket#TYPE_RFCOMM socket.
Defaults to null.
| Returns | |
|---|---|
String |
|
getRfcommUuid
public UUID getRfcommUuid ()
Returns the RFCOMM service UUID used for a BluetoothSocket#TYPE_RFCOMM socket.
Defaults to null.
| Returns | |
|---|---|
UUID |
|
getSocketType
public int getSocketType ()
Returns the type of the Bluetooth socket.
Defaults to BluetoothSocket#TYPE_RFCOMM.
| Returns | |
|---|---|
int |
Value is one of the following: |
isAuthenticationRequired
public boolean isAuthenticationRequired ()
Checks if authentication is enabled for the Bluetooth socket.
Defaults to false.
| Returns | |
|---|---|
boolean |
|
isEncryptionRequired
public boolean isEncryptionRequired ()
Checks if encryption is enabled for the Bluetooth socket.
Defaults to false.
| Returns | |
|---|---|
boolean |
|
toString
public String toString ()
Returns a String that describes each BluetoothSocketSettings parameter current value.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2026-02-26 UTC.
