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

Object clone()

Creates and returns a copy of this object.

boolean equals(Object obj)

Indicates whether some other object is "equal to" this one.

void finalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

final Class<?> getClass()

Returns the runtime class of this Object.

int hashCode()

Returns a hash code value for the object.

final void notify()

Wakes up a single thread that is waiting on this object's monitor.

final void notifyAll()

Wakes up all threads that are waiting on this object's monitor.

String toString()

Returns a string representation of the object.

final void wait(long timeoutMillis, int nanos)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait(long timeoutMillis)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait()

Causes the current thread to wait until it is awakened, typically by being notified or interrupted.

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.

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.