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.

Summary

Nested classes

class BluetoothSocketSettings.Builder

Builder for BluetoothSocketSettings

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 String that describes each BluetoothSocketSettings parameter current value.

Inherited methods

Public methods

getL2capPsm

Added in API level 36
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

Added in API level 36
public String getRfcommServiceName ()

Returns the RFCOMM service name used for a BluetoothSocket#TYPE_RFCOMM socket.

Defaults to null.

Returns
String

getRfcommUuid

Added in API level 36
public UUID getRfcommUuid ()

Returns the RFCOMM service UUID used for a BluetoothSocket#TYPE_RFCOMM socket.

Defaults to null.

Returns
UUID

getSocketType

Added in API level 36
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

Added in API level 36
public boolean isAuthenticationRequired ()

Checks if authentication is enabled for the Bluetooth socket.

Defaults to false.

Returns
boolean

isEncryptionRequired

Added in API level 36
public boolean isEncryptionRequired ()

Checks if encryption is enabled for the Bluetooth socket.

Defaults to false.

Returns
boolean

toString

Added in API level 36
public String toString ()

Returns a String that describes each BluetoothSocketSettings parameter current value.

Returns
String a string representation of the object.