BluetoothSocketSettings
public
final
class
BluetoothSocketSettings
extends Object
java.lang.Object | |
↳ | android.bluetooth.BluetoothSocketSettings |
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.
See also:
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 BluetoothSocket.TYPE_RFCOMM , BluetoothSocket.TYPE_SCO , BluetoothSocket.TYPE_L2CAP , or BluetoothSocket.TYPE_LE |
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.
Returns | |
---|---|
String |
a string representation of the object. |
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 2025-02-13 UTC.